FOR loop outputs twice (PHP)?

Tyler

New member
$sql="SELECT * FROM `post` WHERE `catid`=1 ORDER BY date DESC";
$get_memos=mysql_query($sql) or die(mysql_error());
$num_memos = mysql_num_rows($get_memos);
if($num_memos >= 1) {
echo "<b>$num_memos</b> TABLES<BR>";
for($count = 1; $count <= $num_memos; $count++){
$row = mysql_fetch_array($get_memos);
$pmsgid = $row['msgid'];
$pcatid = $row['catid'];
$postdate = $row['date'];
$ptitle = $row['title'];
$pbody = $row['body'];
$pownerid = $row['ownerid'];
Echo $msgid . ' '. $pcatid . ' '. $postdate . ' '. $ptitle . ' '. $pbody . ' '. $pownerid;
}
} else {
if ($level==9){
echo '<font style="font-size:11px; color:red;">There are no messages in the Daily Memo database.</font>';
}

}

I am using the function above to show each row of catid=1. It displays the information I request, but it outputs each twice.

Guidance please.
I did what you mentioned and it still displayed twice. Thank you for the reply. Any other ideas?
 
Back
Top