RE: [PHP] How to UPDATE two MySQL Tables
| From: | Jay Blanchard | Date: | Fri, 26 Jul 2002 20:35:30 +0000 |
| Subject: | RE: [PHP] How to UPDATE two MySQL Tables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109877@lists.php.net to get a copy of this message | ||
[snip]
....Here's my dilemma: If they do fill in any fields associated with
member_detail, I have to first see whether or not there's an entry in the
member_detail table already for that user (based on member id number). If
not, I then have to check ALL the form fields associated with this table to
see if any data was actually entered so I know whether or not to create a
new record for the member in member_detail. If there is already an entry for
that member in member_detail, then I can just do a standard UPDATE....
[/snip]
Monty,
You can do this in an if statement;
if(this set of variables is there){
insert to database
} elseif(member exists){
update the database
}
HTH!
Jay