PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Assontia Patient   PDO Database class   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Test file to edit before launching
Class: PDO Database class
Access SQL databases using PDO
Author: By
Last change:
Date: 11 years ago
Size: 536 bytes


Class file image Download
// change the values by yours
$a = new db;
$a->table = 'site_colors'; // your table name
$records = $a->select("SELECT * FROM $a->table");
$a->count($a->table) . " records found!";
// records of a table
echo "<pre>";
$records as $r){
// refresh to see the effect of the insert
$a->insert("INSERT INTO $a->table(name, class) VALUES('Blink', 'blink');");
// other or all sql queries can be sent using
$a->sql('DELETE ....');