simplest problem of mysql_num_rows()
Posted: Tue Oct 11, 2005 7:22 pm
Jcart | Please use
Problem:
When there is no record in table acinfo, it doesn't give any result even it can not print "final". what is the problem.
how can it display 0 record. is it the problem with mysql?
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]Code: Select all
<body>
<?
$sql="select * from acinfo ";
$result=mysql_query($sql)or die(mysql_error());
$count1=mysql_num_rows($result)or die(mysql_error());
if($count1>1)
{
echo "hello";
}
else
{
echo "hi";
}
echo "final";
?>When there is no record in table acinfo, it doesn't give any result even it can not print "final". what is the problem.
how can it display 0 record. is it the problem with mysql?
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]