Jump to content

edit data from table


reggie

Recommended Posts

I have created a members area and database that allows users to register etc.all works fine. Members can make a search for other members with certain criteria and view each members profile.Now im stuck....I want to produce an option for members to edit their own profile, some way of showing them their own info, which i know how to do. But not in an input field that they can then edit.All of my form inputs are in html and then uses php to enter data into table. And uses echo"<table>"; in php to view details.Can anyone help with this.

Link to comment
Share on other sites

I have created a members area and database that allows users to register etc.all works fine. Members can make a search for other members with certain criteria and view each members profile.Now im stuck....I want to produce an option for members to edit their own profile, some way of showing them their own info, which i know how to do. But not in an input field that they can then edit.
try using <textarea> <?php //code inputting data from the table; ?> </textarea>.
Link to comment
Share on other sites

Could u give ur code ?but are u thinking of something like this.?

<textarea name="interest">Profile:</textarea><?php$profile = $_POST['interest'];$user = "Here u should have their User";$query = mysql_query("UPDATE your_database SET your_colum = '$profile'  WHERE user = '$user'")if (!$query){echo "there whas an error";}?>

Link to comment
Share on other sites

Could u give ur code ?but are u thinking of something like this.?
<textarea name="interest">Profile:</textarea><?php$profile = $_POST['interest'];$user = "Here u should have their User";$query = mysql_query("UPDATE your_database SET your_colum = '$profile'  WHERE user = '$user'")if (!$query){echo "there whas an error";}?>

no, sir. try
<!-- your html tags will come here together with all input, form, etc. --e.g. <form> Username: <? echo $user; ?> note; you will have to use echo to read each input/output --><textarea><?php echo $profile; // i assume it's only only the interest field ?></textarea>

your mysql_query code will come after the 'submit' button is clicked. did it help??

Link to comment
Share on other sites

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...