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

Return error #57

Open
Lintzman opened this issue Jun 11, 2015 · 5 comments
Open

Return error #57

Lintzman opened this issue Jun 11, 2015 · 5 comments

Comments

@Lintzman
Copy link

Started using your class and it works great except when I had a typo in my SQL and was wondering why nothing was being inserted into my DB. A great addition to the script would be to display an error if a query fails. Keep up the good work.

@thejwalker
Copy link
Contributor

You should be able to use the $lastError variable to return this..

$db = new MySQL('.....');
/query stuff...mmmkay/
echo $db->lastError;

Hope it helps.

@Lintzman
Copy link
Author

Lintzman commented Jul 6, 2015

I'm using the PDO class which doesn't have a lastError variable.

@mrbobdobolina
Copy link

Hi. I know I'm late to the game here, and you're probably better off using a different framework, but if you want to see the error, you can add
echo "\nPDOStatement::errorInfo():\n"; $arr = $stmt->errorInfo(); print_r($arr);
after line 57 in class.DBPDO.php

You'll likely need to comment those lines out or put in a DEBUG = TRUE statement to flip that info on and off... there's probably a better way to do it... but yeah, thats all I got right now.

@mrbeandev
Copy link

has anyone got a solution for this ?
how to see the errors ?

@mrbeandev
Copy link

i got it ! , check my DBPDO.php file > https://github.com/mrbeandev/PHP-MySQL-Class 😄

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

4 participants