This software provides a PHP class that enables SQL abstraction. It allows for easier management of SQL queries, making it simpler to add, update, or remove data from a database.
For instance, take the following 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 numerous jokers that can be used in SQL statements. These jokers are helpful when working with arguments in the TbsSQL command, and n represents the place of that argument in the command:
- %n%: the argument is protected against SQL Injection.
- @n@: the argument is protected against SQL Injection and delimited as a string value with the relevant format for the database.
- #n#: the argument is converted into a date value without time with the relevant format for the database.
- ~n~: the argument is converted into a date and time value with the relevant format for the database.
In conclusion, TbsSQL is an exceptional PHP class that minimizes the amount of code required when working with SQL through PHP. Plus, the compatibility with several databases makes it an excellent choice for developers working across databases. Additionally, it provides a set of jokers that can protect against SQL Injection and convert arguments to appropriate date and time formats.
Version 2.5: N/A