I have a function that updates a row in a table, the query works when I hard coded the email value, but when I want to send the value as $_SESSION
nothing happens in the row, and I won't get any errors either.
My working query is:
function profile_name($profile_name){
$profile_name = mysql_real_escape_string(htmlentities($profile_name));
mysql_query("UPDATE user SET user_name = '{$profile_name}' WHERE user_email = 'my@email.com' ");
}
When I send the my@email.com
as session with the following code:
(isset($_POST['profile'], $_POST["{$_SESSION['email']}"])){ }
function profile_name($profile_name, $email){
$profile_name = mysql_real_escape_string(htmlentities($profile_name));
mysql_query("UPDATE user SET user_name = '{$profile_name}' WHERE user_email = '{$email}' ");
}
nothing happens.
If I echo out the session $_SESSION['email']
it prints my@email.com