PHP code example of catsand / pdo-database-wrapper
1. Go to this page and download the library: Download catsand/pdo-database-wrapper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
catsand / pdo-database-wrapper example snippets
public query($sql, ...value)
public select($sql, ...value)
public selectCell($sql, ...value);
public column($sql, ...value);
public cell($sql, ...value);
public selectRow($sql, ...value);
public fetch($sql, ...value);
public row($sql, ...value);
public selectArray($sql, ...value);
public selectHash($sql, ...value);
public hash($sql, ...value);
public insert($tableName, $valueArray, $columnsArray = array);
public insertIgnore($tableName, $valueArray, $columnsArray = array);
public replace($tableName, $valueArray, $columnsArray = array);
public getLastId();
public lastId();
public getRowCount();
public beginTransaction();
public start();
public executeTransaction();
public finish();
public commit();
public rollBack();
public cancel();
public lock($tableNames);
public unlock();
public query($sql, ...value)
public select($sql, ...value)
public selectCell($sql, ...value);
public selectRow($sql, ...value);
public selectArray($sql, ...value);
public selectHash($sql, ...value);
public insert($tableName, $valueArray, $columnsArray = array);
public insertIgnore($tableName, $valueArray, $columnsArray = array);
public replace($tableName, $valueArray, $columnsArray = array);
$db = new Database\Database('localhost', 'dbname', 'user', 'password');
$result = $db->select('SELECT COLUMN1, COLUMN2, COLUMN3 FROM `table_name` WHERE COLUMN4 = ?s AND COLUMN5 = ?i OR COLUMN6 = ?', 'column4', 5, 'column6');