用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2070|回复: 1
收起左侧

[HELP] 怎么查询mysql数据库啊

[复制链接]
发表于 2014-3-27 16:13:27 | 显示全部楼层 |阅读模式
PHP复制代码
 
$this->load->database();
$query = $this->db->query($sql);
 
复制代码
PHP复制代码
 
$this->load->database();
$query=  $this->db->get('guestbook');
 
复制代码

这两段报错内容:Fatal error: Call to a member function database() on a non-object in X:\www\CI-study\application\models\blog_model.php on line 19;
该怎么写呢


发表于 2014-3-28 10:08:18 | 显示全部楼层
本帖最后由 ^淡如清风 于 2014-3-28 10:10 编辑

从问题来看,楼主应该没有看完文档吧吧吧吧
罗嗦完毕,附上文档
数据库类文档:
http://codeigniter.org.cn/user_guide/database/index.html

本版积分规则