I have now got my database pulling up the results however it pulls them up on the PHP script page (test.php). I would like to display the results on the form page in form box named 'DOB' and 'email'.
form page:
<form id="form_53" name="login" action="test.php">
<input type="text" name="username">
<input type="text" name="DOB">
<input type="text" name="email">
<input type="submit" style="position:absolute;>
</form>
PHP:
<?php
$host=""; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name=""; // Database name
$tbl_name=""; // Table name
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$username = $_POST['username'];
echo '</br>';
$query = mysql_query("SELECT * FROM `members` WHERE `username`='$username'");
while($result = mysql_fetch_array($query)) {
//display
echo $result['DOB']; //I want this displayed on the 'DOB' form box
echo $result['email']; //I want this displayed on the 'email' form box
}
?>