0
while ( $row = mysql_fetch_array($sql) ) 
{
echo "<table>";
}

if nothing is found in the database relating to the query

i should get like this

while ( $row = mysql_fetch_array($sql) ) 
{
if nothing is found in the database
echo "<table no results found>";
}
2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by tryingtofindout
0

only if the table is empty, i should get no results found message.
otherwise the content of the table should be displayed......

1
$num=mysql_num_rows($sql);
if($num>0)
{
while($row=mysql_fetch_array($sql))
{
echo"<table>";
}
}
else
{
echo  "<table>"."no records here";
}

try like this. i am not sure this is working or not.

Votes + Comments
Thxs!!!
0
if ($sql)
{
echo "<here are the results>";
}
while ( $row = mysql_fetch_array($sql) ) 
{
echo "<display the content in table>";
}

What i need is.........

if ($sql=empty)
{
echo "<here are the results>";
}
while ( $row = mysql_fetch_array($sql) ) 
{
echo "<table no results found>";
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.