苦労しているコードがあります。onclick 関数で関数の「質問」行を表示したいのですが'$questionrow['QuestionContent']'
、括弧内に配置すると、次のようなエラーが表示されます。
解析エラー: 構文エラー、予期しない T_ENCAPSED_AND_WHITESPACE、/xxx7/Mobile_app/previousquestions.php の 119 行目に T_STRING または T_VARIABLE または T_NUM_STRING が必要です
以下の関数で、括弧内に QuestionContent を正しく配置するにはどうすればよいですか。
onclick='parent.addwindow('$questionrow['QuestionContent']');'>Add</button>
以下はコード全体です。
<?php
$output = "";
while ($questionrow = mysql_fetch_assoc($questionresult)) {
$output .= "
<table>
<tr>
<td class='questiontd'>{$questionrow['QuestionContent']}</td>
<td class='addtd'><button type='button' class='add' onclick='parent.addwindow('$questionrow['QuestionContent']');'>Add</button></td>
</tr>";
}
$output .= " </table>";
echo $output;
?>