i have two simon in a field in my database called Fname and simon
in a field called Lname when i search for simon it will only display
one of the simon
in a field called Lname when i search for simon it will only display
one of the simon
Code:
<?php
$link = mysql_connect( "localhost", "user2", "point" );
if ( ! $link )
die( "Couldn't connect to MySQL" );
mysql_select_db( "files", $link )
or die ( "Couldn't open $database: ".mysql_error() );
if (isset($_POST["term"])){
$term = $_POST["term"];
//echo "$term";
$result = mysql_query("SELECT * FROM user WHERE Fname like '%$term%' OR Lname like '%$term%'",$link);
$myrow = mysql_fetch_array($result);
$Fname = $myrow["Fname"];
$Lname = $myrow["Lname"];
$Address = $myrow["Address"];
$Phone = $myrow["Phone no"];
$Email = $myrow["Email"];
echo "$Fname<br>";
echo "$Lname<br>";
echo "$Address<br>";
echo "$Phone<br>";
echo "$Email<br>";
}else {
echo "search not found";
}
?>
Comment