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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.