Board logo

标题: sqlrealy Catching Errors方法 [打印本页]

作者: xiexie    时间: 2016-10-19 10:14     标题: sqlrealy Catching Errors方法

If your call to sqlrcur_sendQuery() or sqlrcur_sendFileQuery() returns a 0, the query failed. You can find out why by calling sqlrcur_errorMessage().

<?
     $con=sqlrcon_alloc("sqlrserver",9000,"/tmp/test.socket","user","password",0,1);
     $cur=sqlrcur_alloc($con);

     if (!sqlrcur_sendQuery($cur,"select * from my_nonexistant_table")) {
             echo sqlrcur_errorMessage($cur);
             echo "\n";
     }

     sqlrcur_free($cur);
     sqlrcon_free($con);
?>





欢迎光临 PHP开发笔记 (http://phpvi.com/) Powered by Discuz! 6.1.0