-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Julien GARINO edited this page Dec 21, 2013
·
4 revisions
Welcome to the php-pdo-lib wiki!
In order to use this simple php-pdo-library, please proceed this way :
<\?php require_once 'class.database.php'; //Usage //Fetch one record $query = "SELECT id, email FROM users WHERE id=1"; $val = Database::GetInstance()->FetchOne($query); echo $val['id'].' '.$val['email']; //Fetch several records $query = "SELECT id, email FROM users WHERE dateFetchOne($query); if(Database::GetInstance()->Rows()>0){ foreach($results as $val){ echo $val['id'].' '.$val['email'].'
'; }//foreach }//if ?>
I hope this basic library will help you use PDO with PHP. If you have any suggestion, it is welcome to improve the lbrary on the go.
Enjoy ++