I have a very simple development. I was using Pear DB to error catch a quer开发者_Python百科y with something along the lines of
if(DB::isError($create)) die($create->getMessage());
I'm wondering if there is something similar in mysql?
Pear DB is Database Abstraction Layer which works with MySQL.
MySQL:
$res = mysql_query($query);
if(mysql_error()) { die('error!:' . mysql_error() ); }
$res = mysql_query($query) or die(mysql_error());
精彩评论