Login   Register  
PHP Classes
elePHPant
Icontem

File: Test

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Achilleterzo  >  QMySQL  >  Test  >  Download  
File: Test
Role: Example script
Content type: text/plain
Description: Test QMySql
Class: QMySQL
Query MySQL databases tracking the query count
Author: By
Last change: 1° release.
Date: 2003-06-20 16:42
Size: 609 bytes
 

Contents

Class file image Download
<?php
/***********/
/*TEST FILE*/
/***********/


// import class:
require_once("QMySql-class.php");

// Setting UP config class: Host,User,Pass,Database
$Sql = new ClassMySql("HOST","USER","PASS","DATABASE");

// connect to DB:
$Sql->Connect();

// Query DB:
$query $Sql->Query("SELECT * FROM table");

// Use result how a normal query usage:
$row mysql_fetch_array($query);

// print a field:
print $row['field'];

// print query count:
print "Query count:" $Sql->traceQuery() . "<br>\n";

// print errors:
print $Sql->Error();

// close DB:
$Sql->Close();

?>