Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Latest commit

 

History

History
30 lines (20 loc) · 891 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 891 Bytes

A PHP database framework for use with MySQL databases.

The purpose of this project is to take advantage of the MySQLi extension and make queries, prepared statements, and data fetching a whole lot easier.

Here's an example:

<?php

// These can come from anywhere, such as $_GET and don't have to be escaped
$firstname = "Bobby";
$lastname = "Brown";
$username = "bob";

// Insert data with a prepared statement (notice the easy syntax)
$insert = $db->query("INSERT INTO users (firstname, lastname, username) VALUES(?, ?, ?)", array($firstname, $lastname, $username));

// Truthy value if insert was successful, and false if it failed
if ($insert !== false) {

 // Built-in methods such as fetch_row make retrieving data as simple as:
 $user = $db->fetch_row("SELECT firstname, lastname FROM users WHERE username = 'bob'");

 echo $user->firstname;
 echo $user->lastname;

}

?>