April 5, 2012
missing ) after argument list on line 1
Question by Rafael
<script type="text/javascript">$('#multipleResults').show(); $('#multipleResultsOut').html('<table><tr><td colspan="2"><?php echo $lang['search.limited']; ?></td></tr><?php while ($bQr = mysql_fetch_assoc($botquery22)) { echo ('<tr><td style="width: 40px;"><div style="width: 40px; height: 40px; overflow: hidden; background-position: center; background-repeat: no-repeat; background-image: url('%www%/images/badges/'.$bQr['name'].'');"></div></td><td><a href="#" onclick="getBadge('%www%/', ''.$bQr['name'].''); return false;">'.$bQr['badgename'].'</a><br />'.$bQr['desc'].'</td></tr>'); } ?><?php echo $end; ?>;</script><?php echo $lang['search.x.results']; ?>
And I’ve rolled the code again, but still the same error.
Answer by Starx
May be the problem of quotes, the php snippets are also using single quotes as your js script.
Try them this way
$('#multipleResults').show();
$('#multipleResultsOut').html('<table><tr><td colspan="2">'+
<?php echo $lang['search.limited ']; ?>+'</td></tr>'+
<?php while ($bQr = mysql_fetch_assoc($botquery22)) {
echo (' < tr > < td style = "width: 40px;" > < div style = "width: 40px; height: 40px; overflow: hidden; background-position: center; background-repeat: no-repeat; background-image: url('%www%/images/badges/'.$bQr['name'].'');" > < /div></td > < td > < a href = "#" onclick = "getBadge('%www%/', ''.$bQr['name'].''); return false;" > '.$bQr['
badgename '].' < /a><br / > '.$bQr['
desc '].' < /td></tr > ');
}
?>
<?php echo $end; ?>;