creativkook Posted April 10, 2007 Share Posted April 10, 2007 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 More sharing options...
Wildbug Posted April 10, 2007 Share Posted April 10, 2007 Not working? What error do you get? Link to comment https://forums.phpfreaks.com/topic/46483-update-question/#findComment-226317 Share on other sites More sharing options...
gluck Posted April 10, 2007 Share Posted April 10, 2007 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 More sharing options...
fenway Posted April 11, 2007 Share Posted April 11, 2007 Show us the mysql query after variable interpolation -- that is, store the query in an $sql variable, and echo that before you execute it. Link to comment https://forums.phpfreaks.com/topic/46483-update-question/#findComment-226692 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.