medoo– Efficient lightweight PHP database operation class

Source: Internet
Author: User
Tags php database

Website: http://medoo.lvtao.net/

    1. /* medoo.php */ class medoo{protected$database _type = 'mysql'; protected $server = ' localhost '; protected $username = ' your_username '; protected $password = ' Your_password ';}

Just three steps!

  1. 1 //introduction of Medoo2 require_once' Medoo.php ';3 //instantiation of4 $database=NewMedoo ();5 //Insert Data Example6 $database->insert (' account ', [7' user_name ' = ' foo '8' Email ' = ' [email protected] ',9' Age ' = 25,Ten' Lang ' = [' en ', ' fr ', ' JP ', ' CN '] One ]); A //or - $database=NewMedoo ([ -' Database_type ' = ' mysql ', the' database_name ' = ' name ', -' Server ' = ' localhost ', -' Username ' = ' your_username ', -' Password ' = ' Your_password ', +]);

* Only in PHP 5.4+, you can use []As a grammar. Here is the test
1<?PHP2 require_once' init.php ';//contains instantiated Medoo3 4 //var_dump ($database);5 //$datas = $db->select ("Tab1″," * ");6 //$a = $db->query (' select * from ' Tab1″a left joins "tab2″b on A.id=b.pid ')->fetchall ();7 8 $a=$db->select ("Tab1″,9 Array("[>]tab2″=>Array("id" = "pid"),Ten Array( One"Tab1.id (ID1)", A"Tab2.id (ID2)", -"Tab1.value (v1)", -"Tab2.value (v2)", the ) - ); - Var_dump($a); - //Var_dump ($datas); +  - Echo $db->last_query ();

medoo– Efficient lightweight PHP database operation class

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.