dezkit Posted April 13, 2008 Share Posted April 13, 2008 how do i do so if theres nothing in that table, i can echo "There isn't anything, yet." while($row = mysql_fetch_array($result)){ echo $row["member"]; echo "<br>"; } i was thinking while($row = mysql_fetch_array($result)){ echo $row["member"]; echo "<br>"; } else { echo "there are any members yet"; } but it doesnt work. Link to comment https://forums.phpfreaks.com/topic/100906-php-mysql-row-else/ Share on other sites More sharing options...
poleposters Posted April 13, 2008 Share Posted April 13, 2008 $query="SELECT * FROM table WHERE this=this"; $result=mysql_query($query); $number=mysql_num_rows($result); if($number>0) { while($row = mysql_fetch_array($result)){ echo $row["member"]; echo "<br>"; } else { echo " NO users have joined"; } Link to comment https://forums.phpfreaks.com/topic/100906-php-mysql-row-else/#findComment-516029 Share on other sites More sharing options...
Orio Posted April 13, 2008 Share Posted April 13, 2008 <?php if(mysql_num_rows($result) == 0) echo "nada"; else { while().... } ?> Orio. Link to comment https://forums.phpfreaks.com/topic/100906-php-mysql-row-else/#findComment-516032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.