Jump to content

Recommended Posts

Posted

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

Posted

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']

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...