Home > php教程 > php手册 > body text

CodeIgniter 数据库操作 -- 增删改查

WBOY
Release: 2016-06-06 20:00:45
Original
881 people have browsed it

1、获取一个表的全部数据 $this-db-get('mytable'); // Produces: SELECT * FROM mytable 第二和第三个参数允许你设置一个结果集每页纪录数(limit)和结果集的偏移(offset) $query = $this-db-get('mytable', 10, 20); // Produces: SELECT * FROM mytable LI

1、获取一个表的全部数据


$this->db->get('mytable');

// Produces: SELECT * FROM mytable

 

第二和第三个参数允许你设置一个结果集每页纪录数(limit)和结果集的偏移(offset)

 

$query = $this->db->get('mytable', 10, 20);
// Produces: SELECT * FROM mytable LIMIT 20, 10

 

 

设置要查询的字段

$this->db->select('title, content, date');
$query = $this->db->get('mytable');
// Produces: SELECT title, content, date FROM mytable

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!