关于连接数据库
今天学习ci第二天function showstu(){
echo "数据库操作Active Record<hr>";
$this->load->database();
$this->db->from('stu');
$query=$this->db->get();
foreach ($query->result() as $row){
print $row->name."<br>";
}
}
为什么输入
http://........../www/ci/index.php/blog/showstu
提示:
404 Page Not FoundThe page you requested was not found.
database.php 已经修改过 很明显是你的控制器没找到,看看你的控制器是 blog 吗? 就是 他的类名? 是blog 把完整的代码贴出来看看。 我猜应该是这样访问的
http://........../ci/index.php/blog/showstu
页:
[1]