Hello,
I know this is probably an easy question, but I don't know how to do it.
I have 4 columns; name, email, code, ip. I have one form to add rows with just the code column filled and the others left blank. How do I make another form to update those rows to add the rest (name, email, ip)?
Any ideas?
Thanks in advance.
Newbie MySQL Question
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You want to do an UPDATE query. Something like,
Where $name, $email, $ip and $code have all been passed from the second form and table is the name of the table you want to update. $sql is then the query that you would run.
Mac
Code: Select all
$sql = "UPDATE table SET name='$name', email='$email', ip='$ip' WHERE code='$code'";Mac
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK