Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erorrs Under PHP 7.1 #11

Open
aihealthllc opened this issue Aug 7, 2017 · 1 comment
Open

Erorrs Under PHP 7.1 #11

aihealthllc opened this issue Aug 7, 2017 · 1 comment

Comments

@aihealthllc
Copy link

Running colsharpnel/thebestpdowrapper against the example located at the examples page (https://phpdelusions.net/pdo/pdo_wrapper#samples) yields the following:

string(1) "3"
PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'PDO' does not have a method 'run' in /usr/home/demo/thebestpdowrapper.php on line 32

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'PDO' does not have a method 'run' in /usr/home/demo/thebestpdowrapper.php on line 32
PHP Fatal error: Uncaught Error: Call to a member function fetch() on null in /usr/home/demo/test.php:18
Stack trace:
#0 {main}
thrown in /usr/home/demo/test.php on line 18

Fatal error: Uncaught Error: Call to a member function fetch() on null in /usr/home/demo/test.php:18
Stack trace:
#0 {main}
thrown in /usr/home/demo/test.php on line 18

@lucasjkr
Copy link

Sounds like you initialized the original PDO class, and not the MyPDO class that that wrapper provides (as that's where the run method exists.

Rather than $db = new PDO(....), try using $db = new MyPDO(...) instead.

Sorry about the belated response, just stumbled across this now. Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants