I'm trying to make a form that can edit the mysql data. The problem is..there is no error. After I hit the update button...no change on the data.
Here's my code:
editquery.php
<?php
database connection include here..
$id=$_GET['id'];
$result = mysql_query ("SELECT * FROM guestbook WHERE id='$id'");
while ($row = mysql_fetch_array($result))
{
$old_entry = $row["entry"];
}
?>
<form method="post" action="editquery1.php?id=$id">
<textarea cols="80" rows="20" name="entry"><?php echo $old_entry ?></textarea><input type="submit" name="submit" value="Submit">
</form>
The page above showed up fine. It showed the old result. After I edit the entry field...moving down to
.
.
.
editquery1.php
<?php
database connection include here...
$category = $POST['category'];
$id=$GET['id'];
$query = mysql_query("UPDATE guestbook SET entry='$entry' WHERE id='$id'");
print "Entries Updated.<p>";
?>
I also print out the GET and POST field..and they're there..
GET Vars:
id
Post Vars:
entry:submit
What am I doing wrong? :queasy: 😕
Thanks.