runnerjp Posted August 29, 2006 Share Posted August 29, 2006 Parse error: syntax error, unexpected T_ECHO in /home/runnerse/public_html/chatbox/maq.php on line 20[code]<?php#################################include("chatbox/connect.php");#################################mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());// Select the database.mysql_select_db($dbname) or die(mysql_error());$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";$result = mysql_query($query);$marquee = "";$i = 0;while($r=mysql_fetch_array($result)){ $posts[$i] = $r[poster].' - '. $r[message]. ''; ++$i;}$marquee = implode("<img src='http://www.runnerselite.com/image/runner.gif'>", $posts)echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>"?>code][/code] Quote Link to comment Share on other sites More sharing options...
ronverdonk Posted August 29, 2006 Share Posted August 29, 2006 Your last echo must be ended with a semi-colon (;)Ronald 8) Quote Link to comment Share on other sites More sharing options...
Jenk Posted August 29, 2006 Share Posted August 29, 2006 Whilst the above is correct, the error is actually produced because you need a semi-colon at the end of your line with implode() function. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted August 29, 2006 Share Posted August 29, 2006 Missing terminating semi-colon on this line:[code]<?php $marquee = implode("<img src='http://www.runnerselite.com/image/runner.gif'>", $posts) ?>[/code]With this type of error, always look in the preceding lines, as well as the line indicated for the syntax error.Ken Quote Link to comment Share on other sites More sharing options...
runnerjp Posted August 29, 2006 Author Share Posted August 29, 2006 ok i did all that u said [code]<?php#################################include("chatbox/connect.php");#################################mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());// Select the database.mysql_select_db($dbname) or die(mysql_error());$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";$result = mysql_query($query);$marquee = "";$i = 0;while($r=mysql_fetch_array($result)){ $posts[$i] = $r[poster].' - '. $r[message]. ''; ++$i;}$marquee = implode("<img src='http://www.runnerselite.com/image/runner.gif'>", $posts) ?echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>";?>[/code]yet still an error on lien 20 :S Quote Link to comment Share on other sites More sharing options...
Jenk Posted August 29, 2006 Share Posted August 29, 2006 Have a read on php.net about syntax. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted August 29, 2006 Share Posted August 29, 2006 still missing the semi-colon at the end of the implode line, not a question mark Quote Link to comment Share on other sites More sharing options...
Iceman512 Posted August 29, 2006 Share Posted August 29, 2006 Hi runnerjp,Try this:[code]<?php#################################include("chatbox/connect.php");#################################mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());// Select the database.mysql_select_db($dbname) or die(mysql_error());$query = "SELECT poster, message FROM ch_messages order by id DESC LIMIT 5";// Otherwise, replace the above line with the following line;// $query = ("SELECT poster, message FROM ch_messages order by id DESC LIMIT 5");$result = mysql_query($query);$marquee = "";$i = 0;while($r=mysql_fetch_array($result)){ $posts[$i] = $r[poster].' - '. $r[message]. ''; ++$i;}$marquee = implode("<img src='http://www.runnerselite.com/image/runner.gif'>", $posts);echo "<marquee><font size='3'><span style='color: white'>". $marquee. "</span></font></marquee>";?>[/code]Regards,Iceman Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.