Can someone please explain to me why I cant seem to get my mysql update line to work. I have been trying for a while an still nothing. I am new in php and need some help getting this to work. Please be gentle. a good explaination in newbie talk would be appreciated.
The session variable I echoed out does work so I know I am reading the variable in from the other page.
thanks
<?php
session_start();
/*
Server side scripting with php
CISS 225
Lab # Final Project
*/
//This section will create variables collected from information sent
//by the post method on the createUserProcess.
/* $_SESSION['city'] = $_POST['city'];
$_SESSION['state'] = $_POST['state'];
$_SESSION['zipCode'] = $_POST['zipCode'];
$_SESSION['profession'] = $_POST['profession'];
$_SESSION['activities'] = $_POST['activities'];
$_SESSION['hobbies'] = $_POST['hobbies'];
*/
$city = $_POST['city'];
$state = $_POST['state'];
$zipCode = $_POST['zipCode'];
$profession = $_POST['profession'];
$activities = $_POST['activities'];
$hobbies = $_POST['hobbies'];
$db = mysql_connect("localhost", "root", "");
mysql_select_db("accountprofile",$db);
echo $_SESSION['Email'];
//$query = "UPDATE accountprofile SET city = '$city', state = '$state', zipcode = '$zipCode', profession = '$profession', " . "
//activities = '$activities', hobbies = '$hobbies' WHERE lastName = 'Hildebrand'";
$query = "UPDATE accountprofile SET city = '$city', state = '$state', zipcode = '$zipCode', profession = '$profession',
activities = '$activities', hobbies = '$hobbies' WHERE userName = " .$_SESSION['Email'].""; mysql_query($query,$db);
if (mysql_error())
{
echo "$query<br />";
echo mysql_error();
}
echo "THANK YOU!<br />";
echo "Your profile has been completed!<br />";
?>