fazlionline Posted June 1, 2009 Report Posted June 1, 2009 I have a database of users, they have filled the form. Now they want to update their information. I want the user should change all of his information, if the user name & pass in the form (is equal to ) user name & pass in the database. This code is not working: <?php // Make a MySQL Connection // Insert a row of information into the table "mytbl" mysql_query("UPDATE mytbl SET regname = '$_POST[updname]', regdob = '$_POST[upddob]', regdomi = '$_POST[upddomi]', regmob = '$_POST[updmob]' , regcountry = '$_POST[updcountry]', regcity = '$_POST[updcity]', regposition '$_POST[updposition]', regorg = '$_POST[updorg]', regpro = '$_POST[updpro]', regedu = '$_POST[updedu]', regemail = '$_POST[updemail]', WHERE regid = '$_POST[updemail]' AND regpass = '$_POST[updemail]'"); echo "Data Updated!"; ?> Thanks Quote
BeeDev Posted June 1, 2009 Report Posted June 1, 2009 Hi, You should store those values from the $_POST into variables. I don't think you can use $_POST[fieldname] without quotes. Proper syntax is: $_POST['fieldname'] Quote
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.
Note: Your post will require moderator approval before it will be visible.