/    Sign up×
Community /Pin to ProfileBookmark

Problem to update (edit)

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

[code=php]
<?
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”);

}
?>
[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@bokehMar 12.2006 — Could it be anything to do with [I]date [/I]and [I]time[/I] being reserved words.

Also you seem to have an extra comma after [I]'$budget'[/I].
Copy linkTweet thisAlerts:
@inventiveauthorMar 13.2006 — 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.
×

Success!

Help @inventive spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...