Database displaying partial values
Posted: Tue Dec 13, 2005 11:05 pm
I have a form that places values into a database.
Connects like:
Pulls up the values of the database and puts them into a form as pre-filled in values:
and that goes on and on. And when the user presses submit it puts the values in a database.
But if the user then refreshes the page or goes to update their values, it doesnt display anything after a space or comma. So if someones answer is say: Austin, Texas it only displays Austin, and cuts off Texas, but the full responce is in the database.
Why is it cutting off the values when displaying them in the form again, thus requireing the user to change all of their entries again if they want to update stuff, or they would lose all their entries that contain stuff after a space or comma.
Thanks in advance.
Connects like:
Code: Select all
$result = mysql_query("SELECT * FROM survey
WHERE Uname='{$_SESSION['Uname']}'") or die(mysql_error());
$row = mysql_fetch_array( $result );Code: Select all
echo "<table><form method=post action=survey.php?action=update>";
echo "<tr><td><font size=2>Name:</td><td><input type=text name=name value=" . $row['name'] . "></td></tr>";
echo "<tr><td><font size=2>Birthday:</td><td><input type=text name=birthday value=" . $row['birthday'] . "></td></tr>";
echo "<tr><td><font size=2>Birthplace:</td><td><input type=text name=birthplace value=" . $row['birthplace'] . "></td></tr>";Code: Select all
$result = mysql_query("UPDATE survey SET name='{$_POST['name']}' WHERE Uname='{$_SESSION['Uname']}'")
or die(mysql_error());
$result = mysql_query("UPDATE survey SET birthday='{$_POST['birthday']}' WHERE Uname='{$_SESSION['Uname']}'")
or die(mysql_error());
$result = mysql_query("UPDATE survey SET birthplace='{$_POST['birthplace']}' WHERE Uname='{$_SESSION['Uname']}'")
or die(mysql_error());Why is it cutting off the values when displaying them in the form again, thus requireing the user to change all of their entries again if they want to update stuff, or they would lose all their entries that contain stuff after a space or comma.
Thanks in advance.