| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Apr 2005
Posts: 383
![]() ![]() | Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING I am getting this error on line 24: Code: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/getgscom/public_html/bf2matchplay/index.php on line 24 Code: <?
include "config.php";
if (is_numeric($_GET['id']))
{
$id = $_GET['id'];
$result = mysql_query("SELECT platform,description,id,title,release_us,msrp,buylink,developer,publisher,esrb,genre,boxart FROM `gamepage` where id = $id") or die(mysql_error
());
while ($row = mysql_fetch_array($result))
{
$title = $row["title"];
$description = $row["description"];
$cat = $row['platform'];
$release_us = $row['release_us'];
$boxart = $row['boxart'];
$msrp = $row['msrp'];
$buylink = $row['buylink'];
$developer = $row['developer'];
$publisher = $row['publisher'];
$esrb = $row['esrb'];
$genre = $row['genre'];
echo nl2br($title . "\n\n" . $description . "\n\n" . $cat . "\n\n" . $release_us . "\n\n" . $boxart . "\n\n" . $msrp . "\n\n" . $buylink . "\n\n" . $developer . "\n\n" . $publisher . "\n\n" . $esrb . "\n\n" . $genre");
}
LINE 24: echo nl2br("\n\n<a href='" . $_SERVER['SCRIPT_NAME'] . "'>Back</a>");
} else
{
$result = mysql_query("SELECT id,title FROM `gamepage`") or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
$title = $row["title"];
$id = $row["id"];
echo "<p><a href='index.php?id=$id'>$title</a></p>";
}
}
?> |
| |
| | #2 (permalink) |
| i love automation Join Date: Nov 2007 Location: xrvel.com
Posts: 1,615
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I have run script below, and had no error... (??) PHP Code:
__________________ |
| |
| | #3 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,074
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | The error is not with line 24. As with most PHP errors you are best looking at the line before the 1 mentioned. ????: NamePros.com http://www.namepros.com/showthread.php?t=403434 You have the following:- PHP Code: I highly advise you to get an editor that checks your code as you write. For example I use Zend Studio. Spotting these types of errors are very easy. Without even running the script the IDE highlights that there is a problem with the line. Take a look HERE as a demonstation.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft
Last edited by Peter; 12-05-2007 at 06:52 AM.
|
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |