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
https://forums.phpfreaks.com/topic/46483-update-question/
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
https://forums.phpfreaks.com/topic/46483-update-question/#findComment-226366
Share on other sites

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.