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
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 ";

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

I got the codeworking now sir, ..actually it's a mistake on my part. Whern I look at my tables, I set postcode and volume as integer, not a varchar, that is why I got some errors. Anyway, thanks for the idea sir, i was able to found out the answer.

 

cheers! ;D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.