elseif(isset($_GET['id']))
{
unset($sql);
unset($query);
$sql = "SELECT ";
$sql.= "* ";
$sql.= "FROM ";
$sql.= "reviews ";
$sql.= "WHERE ";
$sql.= "id = '" . $_GET['id'] . "'";
$query = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($query) > 0)
{
$row = mysql_fetch_array($query);
include(FORMS . 'edit.php');
}
else
{
echo '<p><b>ERROR!</b></p>';
}
}
FORMS/EDIT.PHP
-- BEGIN HTML --
<form action="<?php $SERVER['PHP_SELF'] . '?id=' . $GET['id']; ?>" method="post">
<b>
<p>
Author:
<input name="author" type="text" value="<?php echo $row['author']; ?>" size="50">
</p>
<p>
Game:
<input name="game" type="text" value="<?php echo $row['author']; ?>" size="50">
</p>
-- END HTML --
Does anyone see anything wrong with the code? I don't understand why the form is empty... This is a form to edit the values of a row in the table reviews. I did print_r($row) to test if anything was being returned and the data was but then I am trying to get the data to appear in the form but nothing happens. Please help.