|
刚才写东西,,,,就是不出值....我的sql没问题,,,
我把代码贴出来,,,你们看看那,,
控制器中 function article_list() { $this -> load -> model('Madmin');
$aa['right_lists']=$this ->Madmin -> get_admin_content($this->uri->segment(3));
print_r($aa);
$this ->load ->view('admin/article_list',$aa);
}
model 的代码: function get_admin_content($a34) {
echo $sql="SELECT article.`txtId` , article.`setTime`,article.`title`
FROM article, typedetails,
TYPES WHERE article.`tdId` = typedetails.`tdId`
AND types.`typeId` = typedetails.`typeId`
AND article.`isCommend` =1
AND types.`typeName` = $a34 ";
$query = $this -> db -> query ($sql);
return $query ->result();
}
试图简单的写:
<?php
print_r($right_lists);
?>
执行输出结果,,::
SELECT article.`txtId` , article.`setTime`,article.`title` FROM article, typedetails, TYPES WHERE article.`tdId` = typedetails.`tdId` AND types.`typeId` = typedetails.`typeId` AND article.`isCommend` =1 AND types.`typeName` = 7 Array ( [right_lists] => Array ( ) ) Array ( )
为什么会是空数组呢??
我把上面的sql放在数据库里执行,,没问题,,,,有数据
难道我撞鬼了? |
|