What is the correct syntax for concatenating strings and variables in PHP mysqli prepared statements?
The code I have right now is this:
if ($test_stmt2=$mysqli->prepare("UPDATE friends SET friendslist=friendslist+','+? WHERE friendsuserid=? ")) { //Insert userid and frienduserid into friends table
$test_stmt2->bind_param('si', $friendid, $userid); //Bind parameters (friend user id, your own user id)
$test_stmt2->execute(); //Execute the prepared query
echo "success";
}
Basically, I want to get the string in the friendslist column, add a comma to it, then add another variable string ($friendid) to that cell in the friends table.