3
我試圖用codeigniter創建一個xml響應。當我運行代碼時,會引發以下錯誤。PHP Codeigniter錯誤:調用未定義的方法ci_db_mysql_driver :: result()
此頁面包含以下錯誤:
1號線誤差在列48:在文檔的末尾附加內容
<?php
class Api extends CI_Controller{
function index()
{
$this->load->helper('url', 'xml', 'security');
echo '<em>oops! no parameters selected.</em>';
}
function authorize($email = 'blank', $password = 'blank')
{
header ("content-type: text/xml");
echo '<?xml version="1.0" encoding="ISO-8859-1"?>';
echo '<node>';
if ($email == 'blank' AND $password == 'blank')
{
echo '<response>failed</response>';
}
else
{
$this->db->where('email_id', $email);
$this->db->limit(1);
$query = $this->db->from('lp_user_master');
$this->get();
$count = $this->db->count_all_results();
if ($count > 0)
{
foreach ($query->result() as $row){
echo '<ip>'.$row->title.'</ip>';
}
}
}
echo '</node>';
}
}
?>
你也可以說是正在分析的最終結果? –