开发者

Catching MySQL errors

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()); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜