I am trying to update two columns without deleting the entire row. Here is what I am using:
$sql='update users set token='',timestamp='' where token=?';
$stmt=$db_con->stmt_init();
$stmt->prepare($sql_3);
$stmt->bind_param('s',$token);
$stmt->execute();
However, it gives me this error: T_CONSTANT_ENCAPSED_STRING. Now the query works fine when I use it through the MySQL CLI as update users set token='',timestamp='' where token='blahblah'; How can I get around this?
Use this
You can find more info here how to escape a string.
http://php.net/manual/en/language.types.string.php