如何停止重复的记录 [英] How to stop duplicated records

查看:74
本文介绍了如何停止重复的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个事件管理系统....
我希望每天只能预订3个活动,最多不超过3个
我不知道该怎么做
任何帮助将不胜感激.

I am making a event management system....
I want only 3 events can be booked per day not more than 3
I do not know how to do this
any help will be appreciated

推荐答案

在插入新记录之前,请对存储事件的表运行查询并计算已经存在的事件数.如果已经有3个,则根本不允许用户继续添加新记录.
Before you insert a new record, run a query against your table where you store the events and count how many already exist. If there are already 3, then simply don''t allow a user to continue adding new records.


这篇关于如何停止重复的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆