PHP Scripts - PDO Helper Class - CodeCanyon
PDO Helper Class his title this type of PHPScripts/DatabaseAbstractions This time I will review,made by ser-html, PHPScripts/DatabaseAbstractions is sold at a price of $5 in CodeCanyon.PDO Class // PDO HELPER CLASS // PDO MYSQL // PHP PDO // mysql // pdo // php //
Created | 24 May 13 |
Last Update | 24 May 13 |
Software Version | PHP 5.0 - 5.2, PHP 5.3, PHP 5.4 |
High Resolution | No |
Files Included | PHP |
More Info...PDO Helper Class ..
Check The Full Documentation to See All The Examples.
othPDo is a php class that contains methods will provide an easier and safer way to connect to the database. Getting your query results will be in one line only, and with a lot of agile options that will make your query even more easier than any other method.
Quick Examples:
This will get all the rows from table users$users = $othPDO->getALL("users");This will get all the rows from table users and order it by email
$users = $othPDO->getALL("users","email");This will check the username and password in one line, changing the false to true will return boolean
// Get all for username = othman and password = 1111 $array = array( "username" => "othman", "password" => "1111" ); $users = $othPDO->getWithCondition("*","users",$array,"AND",false);
Search:
This will search for “PHP” in column quote in table search$result = $othPDO->search("search","quote","PHP");
INSERT:
If you are going to pass all the fields in the database, then you can use this.
$arr = array("NULL","newUsername","newPassword","newEmail"); $othPDO->insert("users",$array);
if you are going to pass some of the fields in the database, then you can use this.
$array = array( "id" => "NULL", // if your id is an auto increment field "username" => "myUsername", "password" => "myPassword" ); $othPDO->insert("users",$array);
Execute Your Own SQL Query
$myResult = $othPDO->execute("SELECT * FROM users"); // with vars $myResult = $othPDO->execute("SELECT * FROM users where i = ? AND o = ?",$i,$o);
No comments:
Post a Comment