Jump to content

Mysql Update Code Doesn't work


dlabacs

Recommended Posts

Hi i have this code that doesn't work , I don't know hot to fix this .

 

$sql ="UPDATE advert Set ad_Type = ' Fill wanted ',ad_Volume = ' gfgf ',ad_Weight = ' 89fgfgf ',ad_Street_No = ' fgfgf ',ad_Street_Name = ' lkl ',ad_Suburb = ' lkl ',ad_Postcode = ' klk ',ad_State = ' llkl ' WHERE id = 78 ";

 

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 '

ad_Type = ' Fill wanted ',

ad_Volume = ' gfgf ',

ad_Weight = ' 89fgf' at line 1

 

:'(

:confused:

:(

Link to comment
https://forums.phpfreaks.com/topic/242300-mysql-update-code-doesnt-work/
Share on other sites

I made a change Sir like you've said but still doesn't work. I got the same error. I don't know what happen. I got no idea.

 

$sql ="UPDATE advert Set 
           ad_Type = ' Fill wanted ',
           ad_Volume = ' gfgf ',
           ad_Weight = ' 89fgfgf ',
           ad_Street_No = ' fgfgf ',
           ad_Street_Name = ' lkl ',
           ad_Suburb = ' lkl ',
           ad_Postcode = ' klk ',
           ad_State = ' llkl ' 
           WHERE id = 78 ";

I have a similar problem but mine is more complicated since am supposed to approve the student in the database if true by use of checkbox or submit button to indicate that the detail given by student is true. I have the following query:


  • my  php code does not update the record
  • i have to use ref_no(primary key) in the record to specify the data selected for approval
     
  • the data is in the same table in database
     
  • ilo(person approving) can select more than one students(people in stored in database) for approval.
     

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.