phpretard Posted February 20, 2009 Share Posted February 20, 2009 This code shows Zero if there are now rows. It makes sence but is there a way to not show the Zero and start with 1? $DocCount = mysql_query("SELECT * FROM documents"); $num_rows = mysql_num_rows($DocCount); $i=$num_rows; while($i<=3) { echo "$num_rows document(s) in this row."; $i++ } So if there are no rows the output would be: "1 document(s) in this row" $help="hopeful"; if ($help=="useful") {echo "Thank you PHP Freaks!";} else {echo "Dang...I'll keep banging my head";} Link to comment https://forums.phpfreaks.com/topic/146090-solved-dont-show-the-zero-with-num_rows/ Share on other sites More sharing options...
phpretard Posted February 20, 2009 Author Share Posted February 20, 2009 $i=1; Nevermind Link to comment https://forums.phpfreaks.com/topic/146090-solved-dont-show-the-zero-with-num_rows/#findComment-766937 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.