I have code as follows:
if($row = mysql_fetch_array($result)){
if($rowprev = mysql_fetch_array($resultprev)){
// Do stuff
}
}
The questions I have, if the Row Count from $resultprev = 0 is there anyway to not allow the if statement to run?
Example:
$num_rows_resultprev = mysql_num_rows($resultprev);
if($row = mysql_fetch_array($result)){
if($num_rows_resultprev > 0){
if($rowprev = mysql_fetch_array($resultprev)){
}
// Do something
}
}
Two notes:
1) mysql_num_rows is unreliable, perhaps try a count query:
http://php.net/manual/en/function.mysql-num-rows.php
2) your mysql_fetch_array may actually be returning something (eval to true).
Check the values of your variables and result sets.