I am updating my PHP to use mysqli::
instead of mysql_*
and I have run into an issue with INSERT
statements. I have the following statement:
$stmt = $link->prepare("INSERT INTO `table` (`a`, `b`, `c`) VALUES(?, ?, ?)");
$stmt->bind_param("sss", $a, $b, "0");
$stmt->execute();
I have checked $stmt
and it is a proper mysqli_stmt
object. It is prepared properly, but for some reason, the statement won't execute. I just get a 500 error from my server.
What am I missing?
Edit
I've determined that the issue is coming from the bind_param
method.
Edit 2
Okay, so the error PHP is giving me is this:
Fatal error: Cannot pass parameter 4 by reference in...
This points to the line of bind_param