Hi guys
im trying to display data in to my text fields. im doing this by having a drop down menu, choosing an event, pressing go then have the details for that event appear in the text fields but the values are not being passed in there.
eventID is being passed but none of the others
can any suggest anything
<html>
<body>
<form action="updatethree1.php" method="post" target="_self">
<?php
$db = mysql_connect("localhost", "phpuser", "phpuser03");
mysql_select_db("booking",$db);
$event=mysql_query("SELECT * FROM event ")
OR DIE("Unable to find events. Error: ".mysql_error());
print("<select name=\"EventID\" size=1>\n");
print("<option value=\"b\">Select");
print("<option value=\"b\">-----");
while($row = mysql_fetch_array ($event))
{
print("<option value=\"$row[EventID]\">$row[EventName] \n");
}
print("</select>\n");
?>
<p>
<input type="submit" value="Go">
</p>
<p> </p>
<p> </p>
</form>
<form action="updatethree1.php" method="post" target="_self">
<?php
$EventID=$_POST['EventID'];
$categoryID=$_POST['categoryID'];
$Eventtype=$_POST['Eventtype'];
$EventName=$_POST['EventName'];
$ShowDate=$_POST['ShowDate'];
$Time=$_POST['Time'];
$Venue=$_POST['Venue'];
$Street=$_POST['Street'];
$Town=$_POST['Town'];
$Postcode=$_POST['Postcode'];
$Country=$_POST['Country'];
if ($submit1) {
$sql = "UPDATE event SET EventID='$EventID', categoryID='$categoryID', Eventtype='$Eventtype',EventName='$EventName',ShowDate='$ShowDate'";
//$result = mysql_query($sql);
$result = mysql_query($sql) OR die("Error: ".mysql_error());
echo "Thank you! Information updated.\n";
}
else {
echo $EventID;
$sql = "SELECT * FROM event WHERE EventID='$EventID'"; echo '$EventID'; var_dump()
$result = mysql_query($sql);
//echo mysql_num_rows($result);
if ($result==true) {
$myrow = mysql_fetch_array($result);
}
$myrow = mysql_fetch_array($result);
?>
<input type=hidden name="EventID" value="<?php echo $myrow["EventID"]?>">
EventID: <input type="Text" name="EventID" value="<?php echo $myrow["EventID"]?>"><br>
categoryID: <input type="Text" name="categoryID" value="<?php echo $myrow["categoryID"]?>"><br>
eventtype: <input type="Text" name="eventtype" value="<?php echo $myrow["eventype"]?>"><br>
EventName: <input type="Text" name="EventName" value="<?php echo $myrow["EventName"]?>"><br>
ShowDate: <input type="Text" name="ShowDate" value="<?php echo $myrow["ShowDate"]?>"><br>
Time: <input type="Text" name="Time" value="<?php echo $myrow["Time"]?>"><br>
Venue: <input type="Text" name="Venue" value="<?php echo $myrow["Venue"]?>"><br>
Street: <input type="Text" name="Street" value="<?php echo $myrow["Street"]?>"><br>
Town: <input type="Text" name="Town" value="<?php echo $myrow["Town"]?>"><br>
Postcode: <input type="Text" name="Postcode" value="<?php echo $myrow["Postcode"]?>"><br>
Country <input type="Text" name="Country" value="<?php echo $myrow["Country"]?>"><br>
<input type="Submit" name="submit1" value="Update information">
</form>
<?php
}
?>
</body>
</html>