Edit Info from MySQL database
Moderator: General Moderators
Edit Info from MySQL database
how do i edit info from mysql database. it was put into the db from a form, and i would like to have it edited in a form aswell.
thanks in advanced!
thanks in advanced!
- ambivalent
- Forum Contributor
- Posts: 173
- Joined: Thu Apr 14, 2005 8:58 pm
- Location: Toronto, ON
Code: Select all
UPDATE table SET field_name_1 = 'form_value_1', field_name_2 = 'form_value_2' WHERE id = '$the_one_i_want_to_edit'
- ambivalent
- Forum Contributor
- Posts: 173
- Joined: Thu Apr 14, 2005 8:58 pm
- Location: Toronto, ON
-
satheshf12000
- Forum Commoner
- Posts: 25
- Joined: Mon Sep 04, 2006 5:38 pm
Hi
I think this is what u need.. rite ??
You should use test.php to update the values from this page.
I think this is what u need.. rite ??
Code: Select all
<?php
$host = "localhost";
$account = "username";
$pass = "password";
$dbname = "your_db_name";
$connect=mysql_connect($host,$account,$pass);
$db = mysql_select_db($dbname);
$quer = "select * from uinfo where email='xxxxxx@gmail.com'";
$result = mysql_query($quer);
while($row = mysql_fetch_assoc($result))
{
$name = $row['name'];
$email = $row['email'];
}
?>Code: Select all
<form method="post" action="test.php">
Name: <input type="text" name="t1" value="<?php echo $name;?>">
Email: <input type="text" name="t2" value="<?php echo $email;?>">
<input type="submit" value="Submit">
</form>-
satheshf12000
- Forum Commoner
- Posts: 25
- Joined: Mon Sep 04, 2006 5:38 pm
This problem has been resolved on the forum you advertise in your signature: http://www.vbforums.com/showthread.php?t=432123
Why are you bringing it up here?
Why are you bringing it up here?
Why i brought it here: This is a good place to ask PHP questions, not a VBforumonion2k wrote:This problem has been resolved on the forum you advertise in your signature: http://www.vbforums.com/showthread.php?t=432123
Why are you bringing it up here?
why it is there: because no one is being helpful here. i found a great help there. kinda weird :-/