update sql with session value

i’m trying to get a database updated from a session value with the following script but it doesn’t work

[php] mysql_query("UPDATE users SET

		`Balance` = '$data[Payment_Amount]'
		 WHERE id='$_SESSION[user_id]'
		") or die(mysql_error());

[/php]

any help would be greatly recieved

You just need to add several more single and double quotes:
[php]mysql_query(“UPDATE users SET Balance = '”.$data[‘Payment_Amount’]."’
WHERE id=’".$_SESSION[‘user_id’]."’") or die(mysql_error());[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service