943,936 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 613
  • PHP RSS
Aug 16th, 2009
0

update query

Expand Post »
Hi everybody,
here is my update query ..there is no error but the record is not updated.

anybody know of what should I edit?
Many thanks
php Syntax (Toggle Plain Text)
  1.  
  2. mysql_query("UPDATE lesson SET(`subject`= '{$ins_subject}',`year`='{$ins_year}',`noofstudents`='{$ins_noofstudents}',
  3. `minutes`='{$ins_minutes}',`ability`='{$ins_ability}',`learningArea`='{$ins_learningArea}',`objectives`='{$ins_objectives}',
  4. `LO`='{$ins_LO}',`skills`='{$ins_skills}',`prerequisite`='{$ins_prerequisite}',`resources`='{$ins_resources}',`introduction`='{$ins_introduction}',
  5. `activity`='{$ins_activity}',`step2`='{$ins_step2}',`step3`='{$ins_step3}',`step4`='{$ins_step4}',`assessment`='{$ins_assessment}',
  6. `reflection`='{$ins_reflection}',`closure`='{$ins_closure}',`extension`='{$ins_extension}',`author`='{$ins_author}') WHERE lessonID='$id'") ;
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
tulipputih is offline Offline
107 posts
since May 2009
Aug 16th, 2009
0

Re: update query

How about trying your WHERE-Clause? My best advice is to echo your query, examine it and check Mysql_error() or just copy and paste it to PHPmyAdmin. Some sort of this question can't and won't be answered by anyone here in the forum.
Reputation Points: 56
Solved Threads: 29
Posting Whiz in Training
sDJh is offline Offline
255 posts
since Aug 2005
Aug 17th, 2009
0

Re: update query

Thanks sDjH,
I have tried as what you suggest.
here is the error..
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1.

I tried to understand what it is..but still was not able to solve it.
Any suggestion?
Thanks
Reputation Points: 10
Solved Threads: 0
Junior Poster
tulipputih is offline Offline
107 posts
since May 2009
Aug 17th, 2009
0

Re: update query

check all the quotes and commas and braces, perhaps your are missing some thing that's way problem is arising. and there is no need to apply braces around the variables.
Reputation Points: 16
Solved Threads: 48
Posting Whiz
BzzBee is offline Offline
327 posts
since Apr 2009
Aug 17th, 2009
0

Re: update query

try to remove all { } just use ' '
remove also all ``

EXAMPLE -----> UPDATE lesson SET(subject= '$ins_subject', year = '$ins_year', .....................
Last edited by phpbeginners; Aug 17th, 2009 at 9:20 am.
Reputation Points: 12
Solved Threads: 32
Posting Whiz in Training
phpbeginners is offline Offline
226 posts
since Jul 2009
Aug 19th, 2009
0

Re: update query

Hello,
thanks for your suggestions..
It was settled ..
Reputation Points: 10
Solved Threads: 0
Junior Poster
tulipputih is offline Offline
107 posts
since May 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: how to enter data in database from HTML form
Next Thread in PHP Forum Timeline: php: compare array values from 2 tables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC