Website: http://medoo.lvtao.net/
/* medoo.php */ class medoo{protected$database _type = 'mysql'; protected $server = ' localhost '; protected $username = ' your_username '; protected $password = ' Your_password ';}
Just three steps!
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