Jump to content

[SOLVED] Dont show the Zero with num_rows


phpretard

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.