RE: [PHP] Limit number of entries in a MySQL DB
| From: | Jason Stechschulte | Date: | Mon, 25 Sep 2000 17:59:46 +0000 |
| Subject: | RE: [PHP] Limit number of entries in a MySQL DB | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17365@lists.php.net to get a copy of this message | ||
You could make a primary key like this:
primary key(week, team)
That would mean you could not have the same week for the same
team and vice versa. Or you could try doing a select with the
information you have before doing the insert. If the info
already exists, then you would want to do an update instead.
Jason Stechschulte
jpstech@nc.edu
-----Original Message-----
From: Scott Webb [mailto:scott@hostiq.com]
Sent: Friday, September 22, 2000 12:17 AM
To: php-general@lists.php.net
Subject: [PHP] Limit number of entries in a MySQL DB
I am trying to limit entries into a MySQL database to avoid
duplicate
entries. Users will input values for a $week and $team. Teams
can have
multiple weeks, but there can not be multiple weeks per team.
How can I check the MySQL DB prior to inputting values and if
there is
already values matching the $week and $team criteria exit and
redirect to an
update page?
Hope this makes sense. I believe this should be fairly simple,
but am not
sure where to start. Any help would be appreciated.
Thanks,
Scott