✓ PHP ORM
✓ familiar syntax
✓ zero hassle, zero configuration
✓ easy to use, simple to learn
✓ flexible, fast, powerful and smart
✓ PHP 5.3 or newer
✓ mysql, postgresql, sqlite, sqlserver, oracle, etc.
✓ MIT license
Example of connection with MySQL:
require "path_to_wdb_folder/WDB.php";
use NCB\WDB\WDB;
$db = new wdb(array(
'type' => wdb::MYSQL,
'server' => 'localhost',
'dbname' => 'myDB',
'user' => 'userName',
'pswd' => 'passwort',
));
Selection example: We take the columns userid, name, email et age from the table users for the user whose email is emilio@gmail.com
$db->select
( "users",
array("userid" , "name", "email", "age"),
array("email" => "emilio@gmail.com")
);
/* We take the result */
$user = $db->fetch();
Adding data: We add two new users to the users table. We assume that this table contains only the columns userid, name, age, email and sex and that the column userid is auto-generated (auto-increment for example)
$db->insert(
"users",
array(
"name" => "Eric Chevalier",
"age" => 39,
"sex" => "M",
"email" => "eric.chevalier@gmail.com",
),
array(
"name" => "Emilienne Kennitch",
"age" => 25,
"sex" => "F",
"email" => "e-kennitch@yahoo.fr",
)
);
Tell me something important, but please don't spam.
Powered by w3.css