php - MySQLi UPDATE isn't working. -


for reason can't update work, after hours of googling can't seem find working code.

$stmt = $con->prepare("update user_settings set accept_emails = ? user= '$user'"); $stmt->bind_param('s', '0'); $stmt->execute();  $stmt->close(); 

trying update via ajax, keeps returning 500 server error. should use old mysql way?

i pretty sure can't use literal in bind variables. should use.

$var="0";  $stmt = $con->prepare("update user_settings set accept_emails = ? user=?"); $stmt->bind_param('ss',$var,$user); $stmt->execute();  $stmt->close(); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -