Can anyone tell me why this is not recieving the "id" and $php_self variables into <a href.. tag, when the page is displyed these values are not in the code.
Thanks..
<body>
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("antiques",$db);
$result = mysql_query("SELECT * FROM general",$db);
if ($myrow = mysql_fetch_array($result)) {
echo "<table>\n";
echo "<tr><td>Name</td><td>Description</td><td>Price</td><td>Image Name</td></tr>\n";
do {
printf("<tr><td>%s </td><td>%s </td><td>%s </td><td>%s \n", $myrow["name"], $myrow["description"], $myrow["price"],"<img src=\"images/".$myrow["image_name"]."\">");
printf("<td>%s </tr>\n","<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", $PHP_SELF, $myrow["id"]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
} else {
echo "Sorry, no records were found!";
}
if ($delete) {
$sql = "DELETE FROM general WHERE id=$id";
$result = mysql_query($sql);
echo "$sql Record deleted!<p>";}
?>
</body>