x171306523c 发表于 2012-7-16 14:01:41

CI报错,$fetch_array如何修正

本帖最后由 x171306523c 于 2012-7-16 14:23 编辑


function search(){
$selectsql="select * from soft where title like '%$key%'";

//执行输出列表
$result=$this->db->query($selectsql);
while ($row=mysql_fetch_array($result)) {
   for ($j = 0; $j < 5; $j++) {
    $row=preg_replace("/($key[$j])/i", " <span style=\"color:#F00\"><b>\\1</b></span>", $row);
   }
   return $row;
}
}


while ($row=mysql_fetch_array($result)) 报错,提示 mysql_fetch_array(): supplied argument is not a valid MySQL result resource
如何修改,我是CI新手



我还是不懂 发表于 2012-7-16 14:59:49

看ci的手冊,你這是php的寫法啊
页: [1]
查看完整版本: CI报错,$fetch_array如何修正