SitePoint Zealot
This is a PHP script I made to show a MySQL record:
<?
// connect to our database
require("includes/includes.inc");
if (isset($rID)):
// SHOW ARTICLE
$result = mysql_query("SELECT * FROM reviews WHERE rID = $rID");
if (!$result) {
echo("<p>Houston, we have a problem. Error: " . mysql_error() . "</P>");
exit();
}
$row = mysql_fetch_array($result); ?>
<HTML>
<HEAD>
<TITLE>Adventure Gamer - Reviews - <? echo "$row["title"]" ?></TITLE>
</HEAD>
<BODY>
<b><? echo "$row["title"]" ?></b><br>
<? echo "$row["title"]" ?><br>
<h1><? echo "$row["title"]" ?></H1><br>
</BODY>
</HTML>
I am getting the error "Parse error: parse error, expecting `STRING' or `NUM_STRING' or `'$'' in /home/qgamer/questgamer-www/reviews.php on line 18"
Line 18 is the one with the <TITLE> tag. I went through the script over and over again but couldn't find any slip ups. Does anyone see a bug?
hi
this is not the answer to the parse problem you have but i always get an error with this line of code.
require("includes/includes.inc");
what my server wants is
require("/includes/includes.inc");
hope this helps.
ed
it is the use of two sets of double quotes try using <? print $row["title"] ?> Since its a vraible you wont need the outer quotes when using print
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks