ballhogjoni Posted February 2, 2008 Share Posted February 2, 2008 I have this code here, but it only shows the first record in the db. I know there are multiple records that meet this criteria. What am I doing wrong? $query = mysql_query("SELECT email, fname, lname FROM pageOneInfo_Test WHERE date = '".$date."' AND soldProductTo = '0'") or die(mysql_error()); $row = mysql_fetch_array($query); echo $row['email'].'<br>'.$row['fname']; Link to comment https://forums.phpfreaks.com/topic/89103-solved-guys-what-am-i-doing-wrong/ Share on other sites More sharing options...
p2grace Posted February 2, 2008 Share Posted February 2, 2008 You need to throw it in a while statement. <?php $query = mysql_query("SELECT email, fname, lname FROM pageOneInfo_Test WHERE date = '".$date."' AND soldProductTo = '0'") or die(mysql_error()); while($row = mysql_fetch_assoc($query)){ extract($row); echo $email.'<br>'.$fname; } ?> Link to comment https://forums.phpfreaks.com/topic/89103-solved-guys-what-am-i-doing-wrong/#findComment-456350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.