CodeCanyon smplPDO MySql Database Helper Class 3359730

CodeCanyon smplPDO MySql Database Helper Class 3359730

CodeCanyon smplPDO MySql Database Helper Class 3359730
PHP Script \ Database Abstraction
Wrapper \ Mysql \ Class \ Database \ Abstraction

PHP Script - smplPDO MySql Database Helper Class 3359730 by conradw @ CodeCanyon

PHP Script \ Database Abstraction

Last Update: 9 November 12; Software Version: PHP 5.0 - 5.2, MySQL 5.x; Files Included: PHP.

Latest News
v1.1 released. Existing users must redownload to make sure they’re using the most recent version.

smplPDO is a simple and light-weight class written to extend PHP Data Objects (PDO) with extremely useful features. Shorthand methods packed with it can reduce the amount of duplicate code and increase readability of your scripts as well as improve security and performance with automatically preparing & executing prepared statements .

With smplPDO, you can write fully functional database driven PHP apps with ZERO knowledge of SQL .

// Very simple user authentication example with smplPDO.
$email = array( 'email'=>$_POST['email'] );
// Check if a user exists with the submitted email.
if( ! $db->exists( 'users', $email ) )
exit('User not found!');
// If user is found, check if submitted password is correct.
else if( $db->get_var( 'users', $email, 'password' ) != md5( $_POST['pwd'] ) )
exit('Wrong Password');
// User found & password is correct, so let's welcome with firstname.
echo 'Welcome, ' . $db->get_var( 'users', $email, 'firstname' );

Check out documentation for more code examples.

Main Features

- Lightweight: clean, easy to understand code.

- Uses PHP Data Objects (PDO) with best practises.

- Automatically Creates Prepared Statements.

- Easy Insert, Update, Delete Methods.

- Select Rows, Columns, Variables with one-liners.

- Fully Documented.

- Continuous Support.

Support Contact me if you have any questions or problems with this class. I will do my best to answer all the emails as fast as possible.


// Include class file in your script.
$db_host = 'localhost';
$db_name = 'database';
$db_user = 'db_username';
$db_pass = 'db_password';
// init the class same as PDO
$db = new smplPDO( "mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass );
// INSERT, UPDATE, DELETE with prepared statements.
$db->insert( 'table', array( 'name'=>'John Doe', 'age'=>28 ) );
$db->update( 'table', array( 'age'=>29 ), array( 'name'=>'John Doe' ) );
$db->delete( 'table', array( 'name'=>'John Doe' ) );
// SELECT all, single row, single column and single variable.
$db->get_all( 'table', array( 'age'=>22 ) );
$db->get_row( 'table', array( 'name'=>'John Doe' ) );
$db->get_col( 'table', array( 'age'=>28 ), array('name') );
$db->get_var( 'table', array( 'name'=>'John Doe' ) );
// set them right before any get_* call.
$db->group_by = "age"; // group rows by age field.
$db->order_by = "id DESC"; // order by id field descending.
$db->limit = "0,10"; // get 10 rows starting from 0.
$db->get_all( 'table', array( 'age'=>22 ) );
// Check if a record exists.
if( $db->exists( 'table', array( 'name'=>'John Doe' ) ) ) echo 'Record exists!';
// Get the count of matching records.
$db->get_count( 'table', array( 'age'=>22 ) );
// See the last error catched.
echo $db->error;
// Print out all necessary properties.

Version History

- Minor Bug Fixes and corrections.


- Initial version.

Keywords: abstraction, class, database, db, mysql, pdo, php, wrapper.

Tags: Class, Database, Wrapper, Mysql, Abstraction, MySql

Premium CodeCanyon smplPDO MySql Database Helper Class 3359730 WordPress Themes, Website Templates, Mobile Themes, Flash Templates & Scripts from creative professional designers. Full details of CodeCanyon smplPDO MySql Database Helper Class 3359730 for digital design and education. CodeCanyon smplPDO MySql Database Helper Class 3359730 desigen style information or anything related.


Add Comments:
Enter Code: *