2017 © Pedro Peláez
 

library xsql

xSQL is a wrapper of PDO MySQL

image

camilord/xsql

xSQL is a wrapper of PDO MySQL

  • Monday, March 7, 2016
  • by camilo3rd
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

xSQL

Usage Guide:, (*1)

$sql = new xSQL();

/**
 * DB connection
 */
$sql->connect(array(
        'host' => 'localhost';
        'username' => 'username oh';
        'password' => 'home - his password is unique';
        'database' => 'test';
));

/**
 * query single row
 */
$sql->query("SELECT * FROM table_name WHERE username = ? AND password = ? AND deleted IS NULL", array($username, $password));

// check if query have something...
if ($sql->num_rows() > 0) {

   // fetch data as normal array
   $user_data = $sql->fetch();

   // fetch data as associative array
   $user_data = $sql->fetch_assoc();
}

/**
 * query numbers of row
 */
$sql->query("SELECT * FROM table_name WHERE group_id = ? AND deleted IS NULL", array($username, $password));

// check if query have something...
if ($sql->num_rows() > 0) {

   // fetch all data in normal array..
   $users_data = $sql->fetch_all();

   // fetch all data in associative array..
   $users_data = $sql->fetch_all_assoc();

}

/**
 * insert a row
 */
$sql->insert("INSERT INTO table_name (name, address) VALUES (?,?)", array('Juan' , 'Bonifacio Avenue, Cagayan De Oro City'));

// get last insert id...
$new_id = $sql->last_id();


/**
 * update an entry
 */
$sql->update("UPDATE table_name SET password = ? where username = ?", array(md5('secret_password'), 'foobar'));

The Versions

07/03 2016

dev-master

9999999-dev

xSQL is a wrapper of PDO MySQL

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

sql mysql xsql

07/03 2016

1.0.3

1.0.3.0

xSQL is a wrapper of PDO MySQL

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

sql mysql xsql

07/03 2016

1.0.2

1.0.2.0

xSQL is a wrapper of PDO MySQL

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

sql mysql xsql

07/03 2016

1.0.1

1.0.1.0

xSQL is a wrapper of PDO MySQL

  Sources   Download

The Requires

  • php >=5.0.0

 

07/03 2016

1.0

1.0.0.0

xSQL is a wrapper of MySQLi

  Sources   Download

The Requires

  • php >=5.0.0