I am curious if using the same mysql_query() function twice causes some 
kind of problem.

It seems that if I use

$result = mysql_query($sql, $db);
if (mysql_fetch_array($result)) {
     while ($row = mysql_fetch_array($result) or die("You lose.  No data 
fetched.")) {
          // print some data
          // print a simple sentence to see if the WHILE statement even 
} else {
     // print "No results match your criteria"

In this, I have used the $result variable twice.  $result is essentially 
nothing more than a mysql_query() function.  If I do the above, then the 
IF statement is true but the WHILE statement doesn't seem to produce its 
intended effect.  In other words, I get the die() message "You lose.  No 
data fetched."

This leads me to believe that I can't run two instances of mysql_query() 
or perhaps mysql_fetch_array().

Does anyone know for sure if this is the case?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to