Delivering the best Add-Ons in more than 37 languages.

中文(简体), English, हिन्दी/हिंदी, Español/Castellano, العربية, Русский язык, Français, 中文 (台灣), বাংলা, Bahasa Indonesia, اردو, Português, Deutsch, Bahasa Melayu (بهاس ملايو‎), 日本語 (にほんご), فارسی, Italiano, తెలుగు, Türkçe, ગુજરાતી, Język polski/polszczyzna, Tiếng Việt, ಕನ್ನಡ, Українська мова, ไทย
PHP Scripts / Database Abstractions


— Add-On to

Subscribe to our feed to stay up to date!

New! Follow us as you want it!

PDO CRUD Class - CodeCanyon Item for Sale


Ad: Bluehost hosting

This small class will save you time by providing CRUD methods for quickly building SQL query statements. This can be used and integrated into any existing project with ease. Also, it is great at handling exceptions when SQL errors are produced.

System Requirements

  • PHP 5
  • PDO Extension
  • Supported PDO Driver(s) – PDO_SQLITE, PDO_MYSQL, PDO_PGSQL


 require('class.db.php'); // Create $bind = array( ":id" => $_POST['user_id'], ":user" => $_POST['username']); db::inst()->insert( "users", array(":id", ":user"), 'user_id, username', $bind ); // Read db::inst()->init( "SELECT * FROM users ORDER BY last_name" ); // Update $bind = array( ":signature" => $_POST['signature'] ); db::inst()->update( 'users', array('signature' => ":signature"), array('username',$_SESSION['username']), $bind ); // Delete $bind = array(":id" => $_POST['pID']); db::inst()->delete( "posts", "postID = :id", $bind ); 


  • (08.07.2013) v1.1
    • Emulation set to false for true PDO
    • Fixed issue when error reporting set to E_ALL
    • Added DSN_PREFIX instead of hardcoding the prefix for more flexibility
    • No need to double quote bind parameters anymore
    • Updated for PHP 5.4.x
    • Fixed query method to use bind parameters when not false
    • Updated documentation to reflect changes

Other components in this categoryAll components of this author
CommentsFrequently asked questions and answers


2 December 12

Last Update:
7 August 13

High Resolution:

Files Included:
JavaScript JS, HTML, CSS, PHP

Software Version:
PHP 5.x, MySQL 5.x


eCommerce, eCommerce, All Items, mysql, pdo, postgresql, sqlite