私はこのWebサービスからデータを取得するためにこのPHPスクリプトを実行しようとしていますが、50〜120回は正常に動作しますが、この例外はスローされます。Codeigniter - メンバー関数の呼出し
/* $dataArray = Array(
* "Column1" => "value1",
* "Column2" => "value2",
* and so on...);
*/
foreach ($dataArray as $row => $value)
{
// $value[$PrimaryKey] >>> where condition
// $PrimaryKey >>> name of the column
// $Table >>> table name
if($this->m_myModel->verifyRow($value[$PrimaryKey], $PrimaryKey, $Table))
{
$newArray[] = $value;
unset($dataArray[$row]);
}// if
}// foreach
そして、私のモデル:: これは私のコントローラである私は$ DBを変更することを忘れてしまった
function verifyRow($where, $select, $table)
{
//$this->db->query("SELECT $select FROM $table WHERE $select = $where LIMIT 1");
$this->db->select($select)
->from($table)
->where($select, $where)
->limit(1);
$query = $this->db->get();
if(isset($query->result()[0])) // This is where the error occurs
return true;
else
return false;
}// function verifyRow
[ 'デフォルト'] [ 'db_debug'] FALSEに設定ファイルでは、だから私はDBエラーを取得していなかったので、私は$ this-> db - > _ error_message()を出力しました。そして、この得た:MySQLのサーバは
foreach ($result as $value) {
echo $value['field_name'];
}
または
$name = $result[0]['field_name'];
echo $name;
同じこと、エラーが今、このラインである:$結果= $ query->結果(); #added –
エラーは何ですか? –
致命的なエラー:/data/www/html/application/models/m_myModel.phpのbooleanのメンバー関数result()を呼び出してください。1636 –