Stargate05 Posted July 8, 2010 Share Posted July 8, 2010 Hey all, I've been getting this error: "Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/imissth1/public_html/CodenameKingdom.com/wp-content/plugins/samsarin-php-widget/samsarin-php-widget.php(97) : eval()'d code on line 8" Here is my code, I've tried like a million different changes and cannot seem to find the problem... anyone have any idea?: <?php $connection = mysql_connect("imissthe1_phpb4","[1E199M[1y8W") or die("Service temporairly unavailable"); $db = mysql_select_db("imissthe1_phpb4",$connection) or die("Service temporairly unavailable"); $sql = "select * from phpbb_topics order by topic_last_post_time desc limit 0,5"; $result = mysql_query($sql) or die("Service temporairly unavailable"); for($x=1;$x<=10;$x++){ $row = mysql_fetch_array($result); echo "<a href = "http://www.codenamekingdom.com/forum/f=$row[forum_id]&t=$row[topic_id]/" ;target = \"_blank\">$row[topic_title]</a>"; } ?> Thanks in advance for the help! Link to comment https://forums.phpfreaks.com/topic/207090-frustrating-syntax-error/ Share on other sites More sharing options...
kenrbnsn Posted July 8, 2010 Share Posted July 8, 2010 You have unescaped double quotes in this line: <?php echo "<a href = "http://www.codenamekingdom.com/forum/f=$row[forum_id]&t=$row[topic_id]/" ;target = \"_blank\">$row[topic_title]</a>"; ?> The easiest way around this is to use single quotes inside the string: <?php echo "<a href = 'http://www.codenamekingdom.com/forum/f=$row[forum_id]&t=$row[topic_id]/' ;target = '_blank'>{$row['topic_title']}</a>"; ?> Ken Link to comment https://forums.phpfreaks.com/topic/207090-frustrating-syntax-error/#findComment-1082818 Share on other sites More sharing options...
Stargate05 Posted July 8, 2010 Author Share Posted July 8, 2010 Thanks for the help! Worked great! Just so I dont need to make a new topic, does anyone have any idea how I might be able to add the username of the person who posted the topic and the time and date, using the code that I posted above? Thanks guys! Link to comment https://forums.phpfreaks.com/topic/207090-frustrating-syntax-error/#findComment-1082831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.