TbsSQL is a very simple tool for your PHP applications that makes fast and easy to works with SQL.
-> You have only one file to install for each Database type.
-> You can escape values to prevent from SQL injection and merges them in the SQL statement in one shot.
-> Thus there is no more complicated builds for your SQL statements.
-> It can aslo deleted PHP connection variables after making the connection.
The examples below:
// Retrieve a single value
$Db->GetVal('SELECT * FROM table1 WHERE (id=%1%) AND (type=%2%)', $id, $type);
// Retrieve a single row
$Db->GetRow('SELECT * FROM table1 WHERE (id=%1%) AND (type=%2%)', $id, $type);
// Retrieve all rows
$Db->GetRows('SELECT * FROM table1 WHERE (id=%1%) AND (type=%2%)', $id, $type);
// Retrieve a list of keys/values
$Db->GetList('SELECT id,name FROM table1 WHERE (id>%1%) AND (type=%2%)', $id, $type);
// Execute statements
$Db->Execute('UPDATE table1 SET type=%2% WHERE id=%1%', $id, $type);
$n = $Db->AffectedRows()
$x = $Db->LastRowId()
See the manual to get more information about other features and supported jokers for other types of item values.
|