开发者

Catching MySQL errors

开发者 https://www.devze.com 2023-04-09 03:18 出处:网络
I have a very simple development. I was using Pear DB to error catch a quer开发者_Python百科y with something along the lines of

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

精彩评论

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