PHP Classes

File: Test

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  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: 12 years ago
Size: 609 bytes


Class file image Download

// import class:

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

// connect to DB:

// 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: