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

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!