PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Tom Schaefer  >  QDataObject  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample for data object with one result object
Class: QDataObject
Access MySQL query results as objects
Author: By
Last change: working on factory
Date: 13 years ago
Size: 566 bytes


Class file image Download

@mysql_connect(db_default_host, db_default_user, db_default_password) OR die(mysql_error());
mysql_select_db(db_default_database) OR die(mysql_error());

$sql = "SELECT * FROM customers";

$result = mysql_query($sql);
if(empty($result)) {
  echo "You have to provide a valid resource. Maybe your Query or DB Connection has errors.";

$dataObject = QDataObject::getInstance('mysql',$result);

print "<pre>";
print "</pre>";

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