below is a code to display table rows fetched from DB when the Sql Query returnes result.
<?php
if(isset(['submit']))
{
$key=$_POST['txt_srchKey'];
}
if($key!="")
{
$all_entries=mysql_query("SELECT * FROM tbl_book WHERE bookAuthor='$key'|| bookName='$key'||bookCode='$key' ");
?>
<table border=1 align="left">
<tr>
<td><b>Book Code</b></td><td><b>Book Name</b></td><td><b>Edition</b></td><td><b>Author</b></td>
</tr>
<?php
while($row=mysql_fetch_array($all_entries))
{ ?>
<tr>
<td><?php echo $row['bookCode'] ?></td>
<td><?php echo $row['bookName'] ?></td>
<td><?php echo $row['bookEdition'] ?></td>
<td><?php echo $row['bookAuthor'] ?></td>
</tr>
<?php
}
?>
</table>
I am getting the result in the table when the condition (bookAuthor='$key'|| bookName='$key'||bookCode='$key')is true.but if there is no result it only showing the table headins eg:Book Code, Book Name etc. But instead of this I need to display 'No result found'.How can I do this by editing my code?