I am trying to update a record with the info from a multiple select box, I had it working fine when I was using INSERT INTO to add a new row, but now that I am trying to add it to this code that is using mysql_real_escape_string() it is returning the error message at the bottom of this post. I presume it has something wrong with the value I'm trying to pass into it, but I don't know how to format it to make PHP happy!
$query = "UPDATE studies
SET strategies = '" . mysql_real_escape_string($strategies) . "' WHERE id = '" . mysql_real_escape_string($id) . "'";
while($row = mysql_fetch_array($result)) {
$strategylist = $row['name'];
$strategyname = htmlspecialchars($row['name']);
$pagelink = str_replace(" ","_",$strategylist);
echo '<option value="<a href="strategies.php?strategy=' . $pagelink . '">'.$strategyname.'</a>" >' . $strategyname . '</option>' . '\n';
}
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given on line 100 (that is the line above that starts SET strategies ='".....)