2
<?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'),
                        null, true, $table_name);

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

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


$mdb2->disconnect();
?>

次のエラーが発生します

MDB2エラー:サポートされていません

そして、私は正確に何がサポートされていないのか分かりません。上記のコードは、MDB2マニュアルのpearによって与えられた例です。誰かが私が欠けているものを提案できますか?ありがとう

4

1 に答える 1

3

まず、どのダイ呼び出しがメッセージをエコーし​​ているのかをデバッグします。

die('first: ' . $res->getMessage());

その後、拡張ユーザー情報を確認します。

die($res->getMessage() . "\n" . $res->getUserInfo());

これにより、実際の問題についてのヒントが得られるはずです。

于 2011-06-06T13:58:33.460 に答える