arcset Posted August 4, 2008 Share Posted August 4, 2008 i trying to make a php admin panel. it will have textboxs for firstname ,lastname ,username ,and permissions. I set up the page and it can grab the data from the mysql server and place it in the textboxs but when i try to send the submitted edits to the Mysql server its not changing the row. here is the code i am using to send the data $sql = "UPDATE `Users` SET `username` = $muser, `firstname` = $mfname, `lastname` = $mlname, `permission` = $mau WHERE `username` =$oun";[code] also deleting [code]$query = "DELETE FROM `Users` WHERE `username` = $oun" any help would be loved[/code][/code] Quote Link to comment https://forums.phpfreaks.com/topic/118121-php-sql-help/ Share on other sites More sharing options...
genericnumber1 Posted August 4, 2008 Share Posted August 4, 2008 when you do your mysql_query() add or die(mysql_error()) at the end... mysql_query(**stuffhere**) or die(mysql_error()); But, looking at your code, if you didn't pre-quote around the input variables that are non-int you'll want to quote them, eg... `firstname` = '$mfname' I'll accept my love in hug form. Quote Link to comment https://forums.phpfreaks.com/topic/118121-php-sql-help/#findComment-607730 Share on other sites More sharing options...
budimir Posted August 4, 2008 Share Posted August 4, 2008 You got it all wrong!!! It should be like this $sql = "UPDATE `Users` SET username = '$muser', firstname = '$mfname', lastname = '$mlname', permission = '$mau' WHERE username ='$oun' "; also when you execute your query put or die (mysql_error()); So you could see the error you are getting Quote Link to comment https://forums.phpfreaks.com/topic/118121-php-sql-help/#findComment-607731 Share on other sites More sharing options...
arcset Posted August 4, 2008 Author Share Posted August 4, 2008 TY for all ur help. I sent the hugs in the mail Quote Link to comment https://forums.phpfreaks.com/topic/118121-php-sql-help/#findComment-607763 Share on other sites More sharing options...
genericnumber1 Posted August 4, 2008 Share Posted August 4, 2008 If you're lying about the hugs... I'll find you. Quote Link to comment https://forums.phpfreaks.com/topic/118121-php-sql-help/#findComment-607986 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.