wempy wrote:
try changing this line:
to read:
$query = "UPDATE users SET password = '" . $cpass . "' WHERE userid = $_COOKIE[userid]";
Standard practice would be to concatenate the superglobal and single quote the array key:
$query = "UPDATE users SET password = '$cpass' WHERE userid = ".$_COOKIE['userid'];
However, on my PHP5 setup, I don't see where either usage gives an invalid SQL syntax. See the manual for further details; ATM I can't even think exactly why this is true...late, I guess.
The OP should probably tell his script to echo() the $query and see what it really looks like.