Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vjeux/mysqliwrapper
Short and Secure Queries
https://github.com/vjeux/mysqliwrapper
Last synced: about 1 month ago
JSON representation
Short and Secure Queries
- Host: GitHub
- URL: https://github.com/vjeux/mysqliwrapper
- Owner: vjeux
- Created: 2011-05-06T22:14:50.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-05-06T22:21:20.000Z (over 13 years ago)
- Last Synced: 2024-04-14T15:07:23.943Z (9 months ago)
- Homepage: http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html
- Size: 91.8 KB
- Stars: 9
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
MysqliWrapper - Short and Secure Queries
===============Mysqli Wrapper is shortening the code required to run queries, make them 100% safe against SQL Injections and gives a handy Array as result. No more pain writing queries!
When developing a PHP application, SQL queries is the most dangerous area. This is because the built-in tools are either not secure by conception or too much complicated to use. I've made a little wrapper to mysqli that solves all these problems and make you enjoy writing queries!
What's good about this:
* A single 6 characters function
* Secure because parameterized
* Returns an Array
* Easy migration from the basic methodExample
-------```javascript
$db = new dbWrapper('host', 'user', 'pass', 'database', true);$result = $db->q("
SELECT Name, CountryCode
FROM City WHERE Zip = ? AND Population > ?",
'si', $zip, $pop);foreach ($result as $key => $city) {
// $city['Name'], $city['CountryCode']
}
```Read the full explanation on my blog: http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html