Re: Limit number of entries in a MySQL DB
| From: | Mark Maggelet | Date: | Mon, 25 Sep 2000 17:48:07 +0000 |
| Subject: | Re: Limit number of entries in a MySQL DB | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17383@lists.php.net to get a copy of this message | ||
On Thu, 21 Sep 2000 21:17:19 -0700, Scott Webb (scott@hostiq.com)
wrote:
>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.
if(mysql_num_rows(mysql_query("select * from table where week='$week'
and team='$team'"))){
header("Location: $upate_page");
exit;
}
- Mark