Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 597 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 597 Bytes

PHP-MySQLi

simple php class connect to mysql database

How to use

git clone https://github.com/7elven/PHP-MySQLi.git

Easy Example

require_once '/{path-to}/PHPMySQLi.php';

$db = new PHPMySQLi('localhost','username','password','database');

$sql = "SELECT * FROM users WHERE user = ?";
$params = ["john"]; //$params is array
$result = $db->query($sql,$params);
$fetch = $db->fetch_all($result);

print_r($fetch);

INSERT

$sql = "INSERT INTO users (user,email) VALUES (?,?)";
$params = ["jay","[email protected]"]; //$params is array
$db->query($sql,$params);