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