This is the code the code that i try to run it as my search engine for my database. But i dont understand why i run a notice that undefind index. Can u help me ?
<form method="post" action="search. php">
<input type="text" name="search" size=25 maxlength=25>
<input type="Submit" name="Submit" value="Submit">
</form>
<?
//connect to server
mysql_pconnect( "localhost","ro ot","password") ;
//select the db
mysql_select_db ("school");
//get the results and store them in $result
$search=$_POST["search"];
$result = mysql_query ("SELECT * FROM class WHERE Name LIKE '%$search%'");
//run the while loop
while($r=mysql_ fetch_array($re sult))
{
//grab the result
$Name=$r["Name"];
//print it out
echo $Name;
echo "<br>";
}
?>
<form method="post" action="search. php">
<input type="text" name="search" size=25 maxlength=25>
<input type="Submit" name="Submit" value="Submit">
</form>
<?
//connect to server
mysql_pconnect( "localhost","ro ot","password") ;
//select the db
mysql_select_db ("school");
//get the results and store them in $result
$search=$_POST["search"];
$result = mysql_query ("SELECT * FROM class WHERE Name LIKE '%$search%'");
//run the while loop
while($r=mysql_ fetch_array($re sult))
{
//grab the result
$Name=$r["Name"];
//print it out
echo $Name;
echo "<br>";
}
?>
Comment