Ok I written this script below, its a script that takes variables from a submit form to edit a user profile.
it Works fine and I get the "Success" message at the end so the script executes, BUT it doesnt update the fields like its meant to. for example I write something in the new field and it doesnt change it, it just stays the same.
<?php include "mysql_data.php";
$id = $username;
setcookie("userid","$id","mktime(0,0,0,0,0,2020)");
$userid = $HTTP_COOKIE_VARS["userid"];
$connection = mysql_connect("$host","$login","$pass") or die
("Couldn't connect to server.");
$db = mysql_select_db("$db", $connection) or die
("Couldnt select Database");
$sql = "UPDATE swa_members
SET name = \"$name2\", pass_word = \"$pass_word2\", icq = \"$icq2\", email = \"$email2\", img = \"$img2\", country = \"$country2\", games_played = \"$games_played\", notes =\"$notes2\"
WHERE id = \"$id\"";
$sql_result = mysql_query($sql,$connection) or die ("Couldnt execute query.");
if (!$sql_result) {
echo "Error Failed to Update Profile";
} else {
echo "Profile Updated Successfully";
}
?>
plz help, this one has got me very severely puzzled.