Can anyone figure out why this script isn't returning anything to the browser?
<body>
<?
$db = mysql_connect("ip","user","pass");
mysql_select_db("db",$db);
if ($id) {
// query the DB
$sql = "SELECT * FROM table WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
Trip Name:<input type="Text" name="trp_name" value="<?php echo $myrow["trp_name"] ?>"><br>
Region:<input type="Text" name="region" value="<?php echo $myrow["region"] ?>"><br>
Country:<input type="Text" name="country" value="<?php echo $myrow["country"] ?>"><br>
Cost:<input type="Text" name="cost" value="<?php echo $myrow["cost"] ?>"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?
} else {
// display list of trips
$result = mysql_query("SELECT * FROM table",$db);
while ($myrow = mysql_fetch_array($result)) {
printf("<a href=\"%s?id=%s\">%s %s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["region"], $myrow["country"]);
}
}
?>
</body>