当我的网站上有用户标识时,他接着打上显示链接的仪表板。 其中一个链接是add course
,其中他认为他可以开办课程......
我想对所有用户使用3门课程的限制,以便所有用户只进入3门课程。 之后,应当发出如下信息:<代码> 到达。
然后他必须选择计划。 我要说的是,我有三项计划: A、B、C
- A has limit of 10 courses
- B has limit of 25 courses
- C has limit of 50 courses
How can I do this?
当我的网站上有用户标识时,他接着打上显示链接的仪表板。 其中一个链接是add course
,其中他认为他可以开办课程......
我想对所有用户使用3门课程的限制,以便所有用户只进入3门课程。 之后,应当发出如下信息:<代码> 到达。
然后他必须选择计划。 我要说的是,我有三项计划: A、B、C
How can I do this?
您可以选择用户迄今为止所开设的课程数目。
为此,您将需要这些课程,以拥有目前用户所特有的东西,通常是使用用户的id。
例如:
SELECT COUNT(user_id) AS numCourses
FROM courses
WHERE user_id = insert_user_id_here
将给您一个包含一个栏的定结果:
这种希望有助于。
这是你能够做到这一点的一种方式。
你们可以为每个用户创造像<条码>选择的计划条码>这样的领域。
否则,该数值可以是default
。 计划A可登录<代码>A等。
i want to apply limit of 3 courses insertion by all users
用户在任何时候插入一个课程表,核对该用户的<>条码>和用户插入的课程数目。
类似于
if(selectedplan="default" && courses<=3)
//add new course
else if(selectedplan="A" && courses<=10)
//add new course
else
// "Cannot add more course, limit reached"
计划修改后<代码>选择的计划代码>外地。
I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...
<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...
我把我的用心从使用QQL转向MySQL。 它与凯科特合作,现在不工作,因为我已经改变,使用MySQL。 这里的错误信息是:
We have a restaurant table that has lat-long data for each row. We need to write a query that performs a search to find all restaurants within the provided radius e.g. 1 mile, 5 miles etc. We have ...
Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...
Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...
What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...
My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...