I followed the Lycos tutorial and that is the code that I ended up with.
I was under the impression that that code would display all of the records held in the database.
I guess I'm wrong though.
I am getting the error that corresponds with the line:
$result = mysql_query($request,$db);
The entire code for reference is:
<head>
</head>
<?php
function mysql_die($error = "unknown")
{
echo "<h1>Error:". $error."</h1>";
exit;
}
$db = mysql_connect("localhost","bornrun","") or mysql_die("Unable to Connect");
mysql_select_db("bornrun_uk_db",$db) or mysql_die("Unable to Select");
$request = "SELECT * FROM 'news' WHERE id=1".$id or mysql_die("Unable to request");
$result = mysql_query($request) or mysql_die("Unable to get result");
$news = mysql_fetch_object($result) or mysql_die("Unable to fetch object");
mysql_free_result($result) or mysql_die("Unable to free result");
?>
</head>
<body background="art/bground.JPG">
<?php echo $news->date ?>
<br />
<?php echo $news->author ?>
<br />
<?php echo $news->news ?>
</body>
</html>
Please show me where I am going wrong!!!
Thanks,
Bailz.