我有一个非常简单的开发。我正在使用梨数据库错误捕捉查询沿线捕捉MySQL错误
if(DB::isError($create)) die($create->getMessage());
我想知道是否有什么类似的mysql?
我有一个非常简单的开发。我正在使用梨数据库错误捕捉查询沿线捕捉MySQL错误
if(DB::isError($create)) die($create->getMessage());
我想知道是否有什么类似的mysql?
梨DB是数据库抽象层,它与MySQL一起工作。
的MySQL:
$res = mysql_query($query);
if(mysql_error()) { die('error!:' . mysql_error()); }
显然他想显示错误,所以在他的情况下:'$ result = mysql_query($ query );如果(mysql_error())死(mysql_error());' –
是的我想显示错误 - (对不起,密集)我不需要传递$结果到参数? ...只是mysql_error() – giles
不,你不。 mysql_error()接受一个可选参数 - 连接。 –
$res = mysql_query($query) or die(mysql_error());
你的意思是mysql命令行本身?如果是这样,是的:http://dev.mysql.com/doc/refman/5.0/en/declare-handler.html –