hi, For testing purposes I wanted to see if i could insert data from a form to a mysql database.
The problem is when using a loop I get all the data for that table as a output. But instead I only want the last submitted data to be shown as a output not the whole databases table.
$selected = mysql_select_db("form_login",$dbh) or die("Could not select form_login");
$result = mysql_query("SELECT * FROM users");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
print " Name: ".$row{'username'}." Password: ".$row{'password'}." News: ".$row{'news'}."<br>";
}
It would be greatful if you could help, thank you.