//add user to the table
$salt = "\$5\$rounds=5000\$" . "gillinghamforprem" . $username . "\$";
$hash = crypt($password, $salt);
// $insertuserquery = $mysqli->("INSERT INTO Users (username, hash, salt) VALUES ('". $username . " ', '" . $hash . "', '" . $salt . "');");
$insertuserquery = $mysqli->("INSERT INTO Users (username, hash, salt) VALUES (?,?,?)");
$insertuserquery->bind_param("sss", '". $username . " ', '" . $hash . "', '" . $salt . "');
$insertuserquery->execute();
mysqli_query($con, $insertuserquery) or die("4: Insert user query failed"); // error #4 - insert queryfailed
echo("0");
Hi i am getting a parse error, i am learning to convert code to prepared statements and struggling with this insert section.
any help would be helpful.