thinkphp simple operation of database access, thinkphp database access
Traditional SQL vs. sql in thinkphp with the user table as an example
$user=m (' user '); 1:select * from user----------$user, SELECT (); 2:select* FORM user WHERE id=2---------$user->find (2); 3:select username formuser-----$user->field (' username '),SELECT ();
4:delete FORM username whereid=2------$user->delete (2);
5:update user SET username= ' newusername ' WHERE id=2-------$data [' username ']= ' newusername ' $user->save ($data);
6:insert into User (Name,password) VALUES (' php ', ' phppwd ')------$data [' name ']= ' php ' $data [' Password ']= ' phppwd ' $ User->add ($data);
http://www.bkjia.com/PHPjc/1029945.html www.bkjia.com true http://www.bkjia.com/PHPjc/1029945.html techarticle thinkphp Simple operation of database access, thinkphp database access traditional SQL compared to SQL in thinkphp to the user table as an example $user =m (' user '); 1:select * FROM User----------$u ...