Hidden

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
silgol
Forum Newbie
Posts: 11
Joined: Fri Jan 24, 2003 1:31 pm

Hidden

Post by silgol »

It wanted to know as step a variable hides (that it is the key of a
table) to update the modified registries?
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

I'm not completely sure what you mean, but if your are asking how to update information in a mysql database then you don't need keys. All you need to know is the name of the information you want to update.

Let's say you have a simple table called INFO with NAME AGE EMAIL

If you wanted to update the EMAIL you can do something like this...

$newEmail is the new email address.. and $whosEmail is the NAME of the person whos email you want to update.. then use.....

Code: Select all

<?php
mysql_query(" UPDATE `info` SET `email`='$newEmail' WHERE `name`='$whosEmail' ");
?>
Hope this helps.
Post Reply