attach is my code for search.php but i have error on line 9, can someone pleasee help me to fix it ? Thnk you
XAMPP said
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\series\insert\Search.php on line 9
line 9 code:
while($row = mysql_fetch_array($results)){
below is my full code :
<?php
if($_GET){
$search=$_GET['search'];
$connect =mysql_connect("localhost","root","");
if($connect){
mysql_select_db("b_database",$connect);
$query = "SELECT * FROM b_database WHERE search='". $search . "'";
$results=mysql_query($query);
while($row = mysql_fetch_array($results)){
echo $row['isbn']. "<br/>". $row['title']. "<br/>";
}
}else{
die(mysql_error());
}
}
?>
<form action="" method="GET">
<table style=" border:1px solid silver" cellpadding="10px" cellspacing="0px" align="center">
<tr><td colspan="4" style="background:#0066FF; color:#FFFFFF; fontsize:20px">Search Record</td></tr>
<tr>
<td>Enter Search </td>
<td><input type="text" name="search" size="40" /></td>
<td><input type="submit" value="Go" /></td>
</tr>
</form>