Database Data Model
How to use
Constructing a database table model
$beian =m (' Beian ');
Auto-populate Triple-a BBB field $_post also have these two fields
$beian->create (Array ("AAA", "bbbb"));
Fill in $data
$beian->create ($data, Array ("AAA", "bbbb"));
Take two primary key values, sorted as ascending
Print_r ($beian->get (53,54, ' ASC '));
Assigned to a field.
$beian->userid=2;
$beian->language=1;
$beian->setuserid (55);//Use function method to prevent errors
$beian->setlanguage ("US");
Direct post Warehousing mapping Operation example:
$gbook =m ("Gbook")->create ("Fix", Array ("content" => "comment"))->save ();
Content is a database field
Comment is $_post field key so allow different values to be submitted in
Print already assigned fields
Print_r ($beian->data);
Save, and then display the ID you just inserted
echo $beian->save ()->pkid ();
Set Primary KEY and then delete
Echo ($beian->pkid ()->delete ()) This article links http://www.cxybl.com/html/wlbc/Php/20130326/37400.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.