Medoo and error managment
Hi
first of all, thank you fort the good work! I really like using Medoo, this is so easy!
However, i have to say that i don t really understand how it work when there is an error, for exemple, if i do a select request for a table that doesen t exist, how can i get the error specificly and not the array with var_dump($Db->error());
I'm sorry but i really don t understand?
I mean, if i don 't want the array to be display on the screen of the visitor, is there a possibility to create a variable when there is an error, and then look with isset() if this variable exists? So i would be abble to show an specific error message to my visitor?
medoo gives back array from errorInfo from pdo/php, so have a look at http://php.net/manual/de/pdo.errorinfo.php
I think you're looking for the error code (e.g. 42S02) which is index [0] in the array. So instead of var_dump you can try echo $database->error()[0];
and handle based on error codes.