Closed mysizeofcn closed 7 years ago
Oh forget version , so I used the Medoo Version is 1.4.1
If return 00000, that mean is successful and nothing wrong.
http://php.net/manual/en/pdo.errorcode.php
The message number is depends on PDO driver. Having a number doesn't mean you are wrong.
I also got this problem, i query a wrong query
ie: $db->select(INVALID_TABLE,[]);
then $db->error();
it always return 00000, but there is an error when i var_dump in the core : $query->errorInfo();
select() function:
$query = $this->exec($this->selectContext($table, $map, $join, $columns, $where), $map); return $query->errorInfo();
add this line, it shows the correct error info; but doesn't show when call $db->error();
THANKS 4 MUCH
Well, I checked this issue again. It's a bug return incorrect error info, and I fixed it.
@mysizeofcn Well, i think you can get the error message using $database->error()[2] The 3rd array index holds a readable SQL error Massage that is returned. It works for me, hopefully id does for you as well.
NB always check the first index value of the error e.g ($db->error()[0]), if it equates to 00000 i.e( five zeros), the your last operation run successfully.
To use $database->error() cannot return the error number and error message, the var_dump() tell me the error number is 00000 , please tell me how to deal with it ? Thanks for much.