如何使用pear mdb2调试问题的原因

问题描述

|
<?PHP

 include(\"PEAR/MDB2.PHP\");
      $dsn = \'MysqLi://root@localhost/heart_hugger\';
$options = array(
    \'debug\' => 2,\'result_buffering\' => false,);

$mdb2 =& MDB2::singleton($dsn,$options);
if (PEAR::isError($mdb2)) {
    die($mdb2->getMessage());
}


$table_name = \'cms\';

// if left as a non array all fields of the table will be fetched using \'*\'
// in that case this variable can be set to true,to autodiscover the types
$result_types = \"\";

$mdb2->loadModule(\'Extended\');
$res = $mdb2->extended->autoExecute($table_name,null,MDB2_AUTOQUERY_SELECT,\'cmsId = \'.$mdb2->quote(1,\'integer\'),true,$table_name);

if (PEAR::isError($res)) {
    die($res->getMessage());
}

$row = $res->fetchRow();
echo \"value from fetchrow = \".$row[2];


$mdb2->disconnect();
?>
我收到以下错误   MDB2错误不支持 而且我不知道到底不支持什么。上面的代码是MDB2手册中pear给出的示例。有人可以建议我所缺少的吗?谢谢     

解决方法

        首先,调试哪个模具调用回显该消息:
die(\'first: \' . $res->getMessage());
之后,检查扩展的用户信息:
die($res->getMessage() . \"\\n\" . $res->getUserInfo());
这应该给您有关实际问题的提示。     

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...