Click to See Complete Forum and Search --> : Problem to update (edit)


inventive
03-12-2006, 10:58 AM
I ve problem to update record after insert record.Cannot edit the record.Please help me to overcome this problem.May be there is problem with this codes.

codes - update


<?
include 'dbase.php';

$programmename=$_POST["programmename"];
$location=$_POST["location"];
$cohort=$_POST["cohort"];
$organizer=$_POST["organizer"];
$date=$_POST["date"];
$time=$_POST["time"];
$attendance=$_POST["attendance"];
$consultant=$_POST["consultant"];
$fees=$_POST["fees"];
$budget=$_POST["budget"];
$id=$_POST["id"];

$query = "UPDATE program SET programmeName='$programmename', location='$location', cohort='$cohort',
organizer='$organizer', date='$date', time='$time' , attendance='$attendance', consultant='$consultant',
fees='$fees', budget='$budget', WHERE id='$id'";

$result=mysql_db_query($dbname,$query) or die(mysql_error());

if($result){
header("Location:rekodprogram.php");

}
?>

bokeh
03-12-2006, 11:06 AM
Could it be anything to do with date and time being reserved words.

Also you seem to have an extra comma after '$budget'.

inventive
03-12-2006, 08:08 PM
For date, i used pick up date----javascript.user can choose date from the mini calendar.Time, user just insert it manually.I ve deleted the comma after '$budget', there re no error, but it doesnt update changes. It just go to change page,then it goes to record pages without changes anything.May be, u can give me another sample of update codes.Thanks for ur help.