I am trying to update some columns in a row with MySQL in PHP like so:
$updateuser_sql = "
UPDATE `users`
SET
`HeaderPictureID` = $insertid,
`Bio` = '" . myre($_POST['Bio']) . "',
`ContactEmail` = '". myre($_POST['ContactEmail']) ."',
`PhoneNo` = '". myre($_POST['PhoneNo']) ."',
`TwitterHandle` = '". myre($_POST['TwitterHandle']) ."'
WHERE
`UserID` = '{$_SESSION['userID']}'
";
$mysqli->query($updateuser_sql);
if($mysqli->errno) {
$handlerreturn['status'] = 'USER_UPDATE_FAILURE';
console.log('FAILED');
} else {
$handlerreturn['status'] = 'EXEC_SUCCESS';
console.log('WORKED');
}
Unfortunately this doesn't work and I get the log 'FAILED'. How can I find out, more precisely, what is wrong and work to fix the issue? Am I doing something so obviously wrong?
Thanks!
echo $mysqli->error;?echo $updateuser_sql;?