Let's see if you can help me figure out what is wrong here. I was reading a few tutorials online and got this code from those tutorials and altered it to my needs. I've read about php before and it made no sense until I started doing the actual tutorials and changing them around for something I actually need. Now it's starting to make sense to me.
After an event is submitted I need to be able to go back in and edit any field so I created edit.php, edit_data.php, and edit_form.php
edit.php - lists the events
<?php
include"db.inc.php";//database connection
$order = "SELECT dateum, time, venue, location, event FROM beaded1";
$result = mysql_query($order);
while ($row=mysql_fetch_array($result)){
echo ("$row[time]");
echo "<br/>";
echo ("$row[venue]");
echo "<br/>";
echo ("$row[location]");
echo "<br/>";
echo ("$row[event]");
echo "<br/>";
echo ("<a href=\"edit_form.php?id=$row[dateum]\">Edit</a>");
echo "<br/><br/><br/>";
}
?>
edit_form.php - The form to fill out to edit the field after clicking the edit link above
<?php
include "db.inc.php";//database connection
$order = "SELECT dateum, time, venue, location, event FROM beaded1 WHERE dateum='$id'";
$result = mysql_query($order);
$row = mysql_fetch_array($result);
?>
<form method="post" action="edit_data.php">
<input type="hidden" name="id" value="<? echo "$row[id]"?>">
Time<br/><input type="text" name="time" size="20" value="<? echo "$row[time]"?>"><br/>
Venue<br/><input type="text" name="venue" size="20" value="<? echo "$row[venue]"?>"><br/>
Location<br/><input type="text" name="location" size="20" value="<? echo "$row[location]"?>"><br/>
Event<br/><textarea name="event" rows="5" cols="30" value="<? echo "$row[event]"?>"></textarea><Br/>
<input type="submit" name="submit value" value="Edit">
edit_data.php - The file that should change what's in the edit_form fields
<?php
$time=$_POST['time'];
$venue=$_POST['venue'];
$location=$_POST['location'];
$event=$_POST['event'];
include "db.inc.php";
$id = $_GET["id"];
$order = "UPDATE beaded1 SET time='$time', venue='$venue', location='$location', event='$event' WHERE dateum='$id'";
mysql_query($order);
header("location:index.php");
?>
I don't get any errors but when I hit submit it redirects back to index.php and nothing updates.