Bob wrote:
I am having trouble registering a row from a mysql query
What do you mean with "registering"?
so far I have the mysql part working :
while ( $val = mysql_fetch_array( $result ))
{
print("<tr><td>$val[0]</td>
<td>$val[1]</td>
<td>$val[2]</td>
<td>$val[3]</td>
<td>$val[4]</td>
</tr>\n");
}
OK, this will print as many rows as the number of records returned from
the database.
But, getting these fields into an array for which to register these is a bit
of a problem
any help would be appreciated, as soon as I do the fetch and priint them out
these fields seem lost to the world.
Are you, by any chance, trying to access $val /outside/ the while loop?
<?php
while ($val = mysql_fetch_array($result)) {
print("...");
$valid_data_array = array($val[0], $val[1], $val[2]); // ok here
}
$invalid_data_array = array($val[0], $val[1], $val[2]); // wrong!
?>
You might want to increase the level of error_reporting in your scripts
to have php itself tell you about the use of uninitialized variables and
a few other mistakes in coding that it can catch.
Put these lines at the very beginning of your scripts
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', '1');
?>
HTH
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :