Jump to content

Update Question


creativkook

Recommended Posts

Alright, i should know this, but I haven't worked with PHP in awhile, so I'm fuzzy.  I'm trying to go back and have a user recode something, so it updates the fields in the database.  Everything seems to be running fine, but my query isn't working for some reason.  could someone look at it and make sure the sql is correct?  Thanks!

 

mysql_query("UPDATE plaiddata SET loanAmount = '$loanAmount', longDesc = '$longDescription', aidType2 = '$aidType', environAidType2 = '$environAidType', healthImpact2 = '$healthImpact', crs2Code1 = '$crsCode1', crs2Code2 = '$crsCode2', crs2Code3 = '$crsCode3', crs2Code4 = '$crsCode4', crs2Code5 = '$crsCode5', crs2Code6 = '$crsCode6', masterCRS1 = '$masterCRS1', masterCRS2 = '$masterCRS2', masterCRS3 = '$masterCRS3', masterCRS4 = '$masterCRS4', masterCRS5 = '$masterCRS5', masterAidType = '$masterAidType', masterEnvironAidType = '$masterEnvironAidType', masterHealthImpact = '$masterHealthImpact' WHERE plaidDataID = '$_POST[dataID]'");

Link to comment
Share on other sites

Alright, i should know this, but I haven't worked with PHP in awhile, so I'm fuzzy.  I'm trying to go back and have a user recode something, so it updates the fields in the database.  Everything seems to be running fine, but my query isn't working for some reason.  could someone look at it and make sure the sql is correct?  Thanks!

 

mysql_query("UPDATE plaiddata SET loanAmount = '$loanAmount', longDesc = '$longDescription', aidType2 = '$aidType', environAidType2 = '$environAidType', healthImpact2 = '$healthImpact', crs2Code1 = '$crsCode1', crs2Code2 = '$crsCode2', crs2Code3 = '$crsCode3', crs2Code4 = '$crsCode4', crs2Code5 = '$crsCode5', crs2Code6 = '$crsCode6', masterCRS1 = '$masterCRS1', masterCRS2 = '$masterCRS2', masterCRS3 = '$masterCRS3', masterCRS4 = '$masterCRS4', masterCRS5 = '$masterCRS5', masterAidType = '$masterAidType', masterEnvironAidType = '$masterEnvironAidType', masterHealthImpact = '$masterHealthImpact' WHERE plaidDataID = '$_POST[dataID]'");

 

If I am not wrong then the problem is single quotes. Try using \" instead of single quotes

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.