我的PHP代码中有一个解析错误[关闭]

I have a piece of code which I am struggling on. I want the onclick function to display the "Question" row in the function but when I place '$questionrow['QuestionContent']' within the brackets, it is giving me an error stating:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /xxx7/Mobile_app/previousquestions.php on line 119

How do I place the QuestionContent within the brackets correctly in function below:

 onclick='parent.addwindow('$questionrow['QuestionContent']');'>Add</button>

Below is whole code:

<?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;

        ?>

Put {} around it like you did with the first one:

'parent.addwindow('{$questionrow['QuestionContent']}');'>

I find it much easier to close your string and concatenate with the period. It easier to read than encapsulating them in curly brackets.

<?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;
?>