I have a form that allows me to input data into a database. When the information in the form is submitted it is also returned to let the user know the data has been successfully uploaded. At the moment all of the data in the database is being returned. Ideally I would like only the data being submitted at the time to be returned (which should return one result). Is there a mysql query that will allow this? This is what I currently have:
$query = "SELECT * FROM residents";
$result = mysql_query($query);
while($person = mysql_fetch_array($result)) {
echo "<h3>" . $person['FirstName'] . "</h3>";
echo "<p>" . $person['LastName'] . "</p>";
echo "<p>" . $person['Address'] . "</p>";
echo "<p>" . $person['Birthday'] . "</p>";
echo "<p>" . $person['FormerResidence'] . "</p>";
echo "<p>" . $person['Career'] . "</p>";
echo "<p>" . $person['Education'] . "</p>";
echo "<p>" . $person['SpecialInterests'] . "</p>";
echo '<p><img src="upload/' . $person['Picture'].'" width="70" height="70"/></p>';
}
?>
<?php
I have also tried: while($person = mysql_fetch_assoc($result)) which still returns all of the data in the database instead of just one result.