I'm trying to have a basic news retrieval service that can pull stories out of the MySQL database. I have an example story in the database and the following code in the page:
<html>
<head>
<title>The News</title>
<?php
$db = mysql_connect("localhost","username","password");
mysql_select_db("user_uk_$db);
$request = "SELECT * FROM 'news' WHERE id=".$id;
$result = mysql_query ($request,$db);
$article =mysql_fetch_object($result);
mysql_free_result($result);
?>
</head>
<body>
<?php echo $article->date ?>
<br>
<?php echo $article->author ?>
<br>
<?php echo $article->news ?>
</body>
</html>
with username and pass etc replaced with the relevant data respectively.
When I try to implement the script on the web I get this message:
Parse error: parse error in /data/members/free/tripod/uk/b/o/r/bornrun/htdocs/news.php on line 9
I followed the Lycos tutorial for implementing the database in the page so don't blame me for crappy code.
As you can probably tell i'm not in the best of moods so please be nice!
Regards,
Bailz.