PHP Classes

Query Output Issue

Recommend this page to a friend!

      Har DB Classes  >  All threads  >  Query Output Issue  >  (Un) Subscribe thread alerts  
Subject:Query Output Issue
Summary:A quick note on the query output for this class
Messages:1
Author:DigiOz Multimedia
Date:2006-03-03 16:27:59
 

  1. Query Output Issue   Reply   Report abuse  
Picture of DigiOz Multimedia DigiOz Multimedia - 2006-03-03 16:27:59
First, I would like to thank you for writing this wonderful class. It has been a great help in working with MS Access (.mdb) databases.

I looked at your 'accesstest.php' sample file, and was not able to fetch any records using fetchObject() function. The fetchArray() funtion works fine, but the example did now show how to fetch multiple records using fetch array. So I modified the example to fetch multiple records. Here is how I used fetchArray() function:

$db=new DB;
$db->open("data.mdb");
$output = array();

$sql = 'Select * FROM [tableName]';
$db->query($sql);
while($output = $db->fetchArray())
{
echo "C1: ".$output[0]."<br>";
echo "C2: ".$output[1]."<br>";
echo "C3: ".$output[2]."<br>";
// ...
}

I hope this helps other users trying to use this great PHP Class.

Thanks,
Pete