PHP 5 mysql_fetch_array problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm hoping someone can help me with this.  I am having
problems with the mysql_fetch_array function in PHP
5.0.1 - the code listed below works fine with PHP
4.3.2.

Here is my setup:

A DB class file that has the following for the
mysql_fetch_array (I know this function is OK because
its working when I call it in another section of
code):

	function fetchArray() {
		return(@mysql_fetch_array($this->result));
	}

I have another class file called ListRecords that
basically creates a table and lists the records in
that table.  For some reason it is never getting
inside the first while statement:

	function buildTable($num_fields, $field_name, $db) {
	
		// This is where it is dying
		while($query_data = $db->fetchArray()) {
			echo "<tr>\n";
			$count = 0;
			while($count < $num_fields) {
				$id = $query_data["$field_name[0]"];
				$field = $query_data["$field_name[$count]"];

	      			echo "<td align=\"center\">$field</td>\n";
				$count++;
			}
			echo "<td align=\"center\"><a
href=\"$PHP_SELF?action=viewDetails&$field_name[0]=$id\">View
Record</a></td>\n";
			echo "</tr>\n";
		}
		echo "</table>";
	}

The actual file that calls all of this stuff does so
with the following:

$listrecords->buildTable($num_fields, $field_name,
$db);

When I pull up the page I get no results, but I know I
am connecting to the database because I have a paging
function that is connecting to the db and returning
data.

I've gone through the change log for PHP 5 and didn't
see anything that might be causing this, but maybe I
missed something.  If someone knows what is causing
this it would be extremely appreciated.

Thanks in advance.


		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux