im making a 3x5 grid, each cell of which displays a row of database information. i've successfully created the table, entered data for each cell (15 cells), and displayed it. i have an update button in each cell, which links to a form allowing the user to update/change that information. i pass cell's id in the url: "updateCal.php?id=$id". The trouble is, the database is not updating.
I would greatly appreciate any advice... thanks!
heres the update script im using:
Code: Select all
<?php
include("dbinfo.php");
$ud_id=$_POST['ud_id'];
$ud_date=$_POST['ud_date'];
$ud_event1=$_POST['ud_event1'];
$ud_description1=$_POST['ud_description1'];
$ud_event2=$_POST['ud_event2'];
$ud_description2=$_POST['ud_description2'];
$ud_event3=$_POST['ud_event3'];
$ud_description3=$_POST['ud_description3'];
$ud_event4=$_POST['ud_event4'];
$ud_description4=$_POST['ud_description4'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="UPDATE calendar SET
date='$ud_date',
event1='$ud_event1',
description1='$ud_description1',
event2='$ud_event2',
description2='$ud_description2',
event31='$ud_event3',
description3='$ud_description3',
event4='$ud_event4',
description4='$ud_description4'
WHERE id='$ud_id'";
mysql_query($query);
echo "Record Updated";
echo $query;
mysql_close();
?>