TbsSQL is a PHP class for SQL abstraction. TbsSQL's goal of this tool is to reduce the code when working with SQL through PHP. The TbsSQL is available for the following databases:
- MySQL
- MySQLi
- SQL-Server (via Ms-Odbc)
- PostgreSQL (version 7.2 or higher)
Example:
$id = 29;
$name = "boby";
$Db->Execute('UPDATE table1 SET name=@2@ WHERE (id=%1%)', $id, $name);
In this example, the SQL statement sent to the database will be: UPDATE table1 SET name='boby' WHERE (id=29)
TbsSQL supports the following jokers in your SQL statements (n must be the number of the place of the argument in the TbsSQL command)
- %n% the argument will be protected against Sql Injection.
- @n@ the argument will be protected against Sql Injection and delimited as a string value with the relevant format for the database.
- #n# the argument will be converted as a date value without time with the relevant format for the database.
- ~n~ the argument will be converted as a date and time value with the relevant format for the database.
Product's homepage
What's New in This Release: [ read full changelog ]
· This release brings new features and a few bug fixes. Oracle databases are supported.
· The method ConfInfo() was added to display configuration information at any time.
· New constants include TBSSQL_1MINUTE, TBSSQL_DISABLED, and TBSSQL_ALWAYS.