PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Gombos Lorand  >  PDO_DB  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Example
Class: PDO_DB
Execute database queries from parameters using PDO
Author: By
Last change:
Date: 13 years ago
Size: 624 bytes


Class file image Download
/*Include the DB Class file.*/
include_once 'DB.php';
/*New Connection*/
$c = new DB();
$query = "SELECT * FROM users WHERE message_id = 24";
/*Get one row, if many get the first*/
print "<pre>";

/*Get all rows*/
print "<pre>";

$data = array('text'=>'updated message');
$where = array('message_id = 24');
/*Update data: update message text where the message_id = 24*/

$where = array('message_id = 24');
/*Delete message with id 24*/

For more information send a message to info at phpclasses dot org.