thinkphp simple operation of database access, thinkphp database access _php Tutorial

Source: Internet
Author: User

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 ...

  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.