Jump to content

Frustrating Syntax Error...


Stargate05

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.