{"repo":"paragonie/easydb","free":true,"listed":false,"github":"https://github.com/paragonie/easydb","clone":"git clone https://github.com/paragonie/easydb.git","description":"Easy-to-use PDO wrapper for PHP projects.","language":"PHP","stars":737,"topics":["pdo","php","database","databases","postgresql","mysql","sqlite","prepared-statements","secure-by-default"],"license":"MIT","category":"databases-storage","readme_excerpt":"EasyDB - Simple Database Abstraction Layer PDO lacks brevity and simplicity; EasyDB makes separating data from instructions easy (and aesthetically pleasing). EasyDB was created by Paragon Initiative Enterprises as part of our effort to encourage better application security practices. Check out our other open source projects too. If you're looking for a full-fledged query builder, check out Latitude and Aura.SqlQuery, which can be used with EasyDB. If you'd like to use EasyDB but cache prepared statements in memory for multiple queries (i.e. to reduce database round-trips), check out our EasyDB-Cache wrapper class. Installing EasyDB First, get Composer, if you don't already use it. Next, run the following command: If you've installed Composer in /usr/bin , you can replace /path/to/your/local/composer.phar with just composer . Why Use EasyDB? Because it's cleaner! Let's refactor a dangerous PHP snippet that previously used string concatenation to pass user input instead of prepared statements. For example, imagine something that just dropped {$ GET['blogpostid']} into the middle of a mysql query() statement. Let's make it secure. The PDO Way That's a little wordy for such a simple task. If we do this in multiple places, we end up repeating ourselves a lot. The EasyDB Solution We made it a one-liner. What else can EasyDB do quickly? Insert a row into a database table This is equivalent to the following SQL query (assuming $ POST['blogpostid'] is equal to 123 , $ SESSION['user']","default_branch":null,"files":null,"tree":[],"storefront":"/r/paragonie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/paragonie/easydb/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}