Just wanna leave the info for someone else ....
It works fine
Here is the code for the search.php page .... just put it into the cell you want.
<table>
<tr>
<td>
<form method="post" name="memname" action="result.php"><center>Type in the First Name and Surname :<p>
<input type="text" name="Firstname"> <input type="text" name="Surname"><p>
And then click Submit : <input type="submit" name="submit "value="Submit">
</form>
</td>
</tr>
</table>
And here is the code on the result.php page ...
<?php
[COLOR=blue]$username = "username";
$password = "password";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
$selected = mysql_select_db("database",$dbh) or die("Could not select my database");[/COLOR]
$Firstname = $_POST['Firstname'];
$Surname = $_POST['Surname'];
$query = ("[COLOR=red]SELECT MemberNo,FIrstName,Surname,PlaceOfBirth,Nationality,ClubNo FROM member WHERE FIrstName='$Firstname' AND Surname='$Surname'[/COLOR] ");
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
extract($row);
echo "Member Name: $row[FIrstName] $row[Surname] <br> Birthplace: $row[PlaceOfBirth] <br> Nationality: $row[Nationality] <br> ClubNo: $row[ClubNo] <br>";
}
?>
The blue text is connecting to the database.
The red text is the MySQL query.
Hope this helps !!