Error unterminated string literal when using php javascript?
<p>I have a file with format</p>

<pre><code>&lt;script src="test.php"&gt;&lt;/script&gt;
</code></pre>

<p>And code in test.php with table test(id, name) with 4000 rows</p>

<pre><code>&lt;?php
$sql = "Select * From test";
$data = array();
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
     $data[] = $row;
}
$str = '';
foreach($data as $row) {
    $str .= $row-&gt;name;
}
?&gt;
output('&lt;?php echo $str ?&gt;');
</code></pre>

<p>When I run code is error is <code>unterminated string literal</code>, but when repair code with
<code>$sql = 'Select * From test order by id limit 100'</code> is no error, how to fix it ?</p>
