PDA

Click to See Complete Forum and Search --> : [RESOLVED] Help fixing this Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'


tony007
Jun 3rd, 2008, 01:28 PM
Hi all i try to run the following script but i keep getting error:


Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in c:\server\www\music\paging.php on line 99


pointing at :

'<a href="#" onclick="music=play.open('divbox', 'div','. $row['idyoutube'] .', '. $row['title'] .', 'width=450px,height=400px,left=200px,top=150px,resize=1,scrolling=1'); return false;" title="Play This Video">' .




could any one help me fix this problem ?Thanks


while ($row = mysql_fetch_assoc($result)) {
if ($i % $colsPerRow == 0) {
// start a new row
echo '<tr>';
}


echo '<td width="' . $colWidth . '%">' .
.
'<a href="#" onclick="music=play.open('divbox', 'div','. $row['idyoutube'] .', '. $row['title'] .', 'width=450px,height=400px,left=200px,top=150px,resize=1,scrolling=1'); return false;" title="Play This Video">' .

'<img width="120" src="' . $row['thumbnail_url'] . '" height="90" border="0">' .
'<br>' . $row['title'] . '</a><br />' . $row['view_count'] . '|' . $row['comment_count'] . '=>Status:' . $row['embed_status'] . '</td>';

if ($i % $colsPerRow == $colsPerRow - 1) {
// end this row
echo '</tr>';
}

$i += 1;
}

RudiVisser
Jun 3rd, 2008, 03:12 PM
'<a href="#" onclick="music=play.open('divbox', 'div','. $row['idyoutube'] .', '. $row['title'] .', \'width=450px,height=400px,left=200px,top=150px,resize=1,scrolling=1\'); return false;" title="Play This Video">' .

Seems to be just an escaping issue :)

tony007
Jun 3rd, 2008, 04:39 PM
Ruivisser thanks but your code doesn't put ' around the title and idyoutube !! Without that my onclick function will not work!! could you tell me how to fix that ?Thanks

RudiVisser
Jun 3rd, 2008, 04:56 PM
Well that's not my fault, your code didn't do that in the first place ;) I was going to say something... but anyway :)

'<a href="#" onclick="music=play.open('divbox', 'div', \''. $row['idyoutube'] .'\', \''. $row['title'] .'\', \'width=450px,height=400px,left=200px,top=150px,resize=1,scrolling=1\'); return false;" title="Play This Video">' .

tony007
Jun 3rd, 2008, 06:20 PM
Many Many thanks yeah it was my mistake . it got fixed :-)