Reputation: 145
I change the MySQL to MySQLi in my code
BEFORE: mysql (worked fine)
$set = "costAlertVar ='', costAlertSend = ''";
$eintrag = "UPDATE ".$dbprfx."_users SET $set WHERE connection = '$userConnection'";
$eintragen = mysqli_query($eintrag) or die("Error:".mysql_error());;
NOW: mysqli (not working)
$sql = "UPDATE ".$dbprfx."_users SET costAlertVar = ?, costAlertSend = ? WHERE connection = ?";
$eintrag = $db->prepare( $sql );
$eintrag->bind_param('sss','','',$userConnection);
$eintrag->execute();
$eintrag->close();
Upvotes: 1
Views: 267
Reputation: 191729
mysqli::bind_param
uses the parameters as references, so you have to pass values that can be used as references (i.e. variables).
$costAlertVar = '';
$costAlertSend = '';
$eintrag->bind_param('sss',$costAlertVar,$costAlertSend,$userConnection);
Upvotes: 1