I am grabbing a string from a "title" field and passing it to an addText javascript function.
I am having trouble passing the string properly though. This—>
while ($row = mysql_fetch_assoc($part_result)){
echo "<div id ='link' onclick = 'addText("$row['title']");'>" . $row['title'] ."</div>";
}
yields a syntax error.
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';'
Thanks for your help!
1 Answer