[wd_asp elements=’search’ ratio=’100%’ id=1]

Check if you have a result from query

5th July 2013

MySql

mysql codehaven category

after a mysql query to check if you have a result or not, usually used in a loop

echo "This ".$resultx = mysql_num_rows($result);

if ($resultx == 0) {
} else {
while($row = mysql_fetch_array($result))
{
$monthsofar[] = $row['monthsofar'];
}