Home Live Test

PDOQuery Live Test

Experiment with PDOQuery selectors right here to see just how easy it is to use! The code generated here is using the current version of PDOQuery. The minimal example code shown here is written in PHP5.

$s = PQ("");
$s = PQ("users.where[UserID=3].join:permissions[UserID]");

A standard "select" query using the object's defining selector with no modifications.

$s -> select();
SELECT * FROM users JOIN permissions USING (UserID) WHERE UserID=3
$s -> select("Name, Email");
SELECT Name, Email FROM users JOIN permissions USING (UserID) WHERE UserID=3
$s -> naturaljoin("projects") -> select("users.UserID, COUNT(ProjectID)");
SELECT users.UserID, COUNT(ProjectID) FROM users JOIN permissions USING (UserID) NATURAL JOIN projects WHERE UserID=3
$s -> insert(array("Name"=>"Andrew Wiggin", "Email"=>"ender@battleschool.orbit.earth"));
INSERT INTO users (`Name`,`Email`) VALUES ('Andrew Wiggin','ender@battleschool.orbit.earth')
$s -> update(array("Name"=>"Mazer Rackham", "LastLogin"=>"8/8/2010 8:23pm");
UPDATE users SET `Name`='Mazer Rackham',`LastLogin`='2010-08-08 20:23:00' WHERE UserID=3
$s -> delete();
DELETE FROM users WHERE UserID=3

2010 Copyright Jeff Rowberg. All Rights Reserved. Valid xHTML and CSS