brainstorm Posted June 24, 2009 Share Posted June 24, 2009 Hi All, Please see the code attached...I can't get this update script to actually update the DB. When I click the "update" link on "myadminaccount.php", it brings me over to "update.php" and displays the info from the DB. However, once I change the info and hit submit, it doesn't update the database! Additonally, I get no error. I know this is just something simple that I'm missing and any help you could offer would be much appreciated! Thanks! Brainstorm [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/163486-solved-i-cant-get-update-to-update-the-db/ Share on other sites More sharing options...
patrickmvi Posted June 24, 2009 Share Posted June 24, 2009 Towards the end of your update query, you have an extra comma , user_activated = '$user_activated', where id = '$id' There should not be a comma before "where". That's the first issue I see, you should try using mysql_error to output the error message that MySQL is kicking back to you, if that doesn't help, then post the error message back here so that we can see it. Link to comment https://forums.phpfreaks.com/topic/163486-solved-i-cant-get-update-to-update-the-db/#findComment-862590 Share on other sites More sharing options...
brainstorm Posted June 24, 2009 Author Share Posted June 24, 2009 Thanks! I just fixed the comma, however, what is the code to input the sql error? It's already in the dbc.php. Sorry, still new to php:-) Thanks! Link to comment https://forums.phpfreaks.com/topic/163486-solved-i-cant-get-update-to-update-the-db/#findComment-862600 Share on other sites More sharing options...
patrickmvi Posted June 24, 2009 Share Posted June 24, 2009 The function is mysql_error(), for more information, go here: http://www.php.net/mysql_error Link to comment https://forums.phpfreaks.com/topic/163486-solved-i-cant-get-update-to-update-the-db/#findComment-862863 Share on other sites More sharing options...
brainstorm Posted June 25, 2009 Author Share Posted June 25, 2009 The function is mysql_error(), for more information, go here: http://www.php.net/mysql_error I've got it to work now! Thanks! Apprently I was missing the $_GET variable and then also missing another variable called "amount_due"...As soon as I added them in, it worked perfectly! Thanks again! Link to comment https://forums.phpfreaks.com/topic/163486-solved-i-cant-get-update-to-update-the-db/#findComment-863087 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.