I know that I'm using multiple PHP styles, but I don't know how can I set this.
I think that there something wrong in exit()
; and I don't know what to do to get the desired result.
<?php
$mysqli = new mysqli("localhost", "root", "", "search");
if(isset($_GET['search_button']))
{
$search = $_GET['search'];
if(search=="")
{
echo "<center> <b> Please write something in Search Box </b> </center>"
exit();
}
$sql = "select * from website where site_key like '%$search%' limit 0, 5";
$rs = mysql_query($sql);
if(mysql_num_rows($rs)<1)
{
echo "<center> <h4> <b> Oops !!! Sorry, there is no result found to related the word. </b> </h4> </center>";
exit();
}
echo "<font size='+1' color='#1a1aff'> images for $search</font>";
while($row = mysql_fetch_array($rs))
{
echo "<td>
<table style='margin-top: 10px'>
<tr>
<td>
<img src='img/$row[5]' height='100px'>
</td>
</tr>
</table>
</td>"
}
}
?>