一种webform,每月允许两个条目 [英] A webform which allows two entries per month
本文介绍了一种webform,每月允许两个条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含四个字段的网络表单。姓名,号码,日期,原因。
数据正确插入表格。没问题。
现在我想每月用两个条目验证表格。
我对如何处理这件事情一无所知。
用户每月只能提交两次表格。不超过这个。
任何建议都非常感谢。
解决方案
>我很无能为力关于如何处理这件事。
为什么你不能做类似
SELECT count(*) FROM your_table WHERE 月份( date )=月(getdate())
AND 年(日期)=年(GetDate())
在您尝试插入表格之前?
只有在结果为< 2。
I have a webform with four fields. Name, empno, date, reason.
Datas are inserting properly into the table. No issues with that.
Now I want to validate the form with two entries per month.
I'm clueless on how to approach this thing.
A user can only submit the form twice per month. Not more than that.
Any suggestions is highly appreciated.
解决方案
>I'm clueless on how to approach this thing.
Why can't you make something like
[EDITED]
SELECT count(*) FROM your_table WHERE Month(date) = Month(getdate()) AND YEAR(date) = YEAR(GetDate())
before you try to insert into the table?
You do insert only if your result is < 2.
这篇关于一种webform,每月允许两个条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文