<html>
<head>
<title>Site Title</title>
<?php
function mysql_die($error = "unknown")
{
echo "<H1>Error:". $error."</H1>";
exit;
}
$db = mysql_connect("localhost","username","password") or mysql_die("Unable to connect");
mysql_select_db("databasename",$db);
$requete = "SELECT * FROM article WHERE id=".$id;
$result = mysql_query ($requete,$db)or mysql_die("No record");
$article =mysql_fetch_object($result);
mysql_free_result($result);
?>
</head>
<body>
<?php echo $article->id ?>
<BR>
<?php echo $article->author ?>
<BR>
<?php echo $article->size ?>
<BR>
<?php echo $article->date ?>
</body>
</html>
Does anyone know why this code won't work when I go to:
http://domain.com/site/index.php?id=1