473,385 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to limit the records that user can enter

250 100+
I have php web application and there I have php page for entering stations(Like user). But I want to limit the Number of records. User can only enter the 30 records. How can I limit that?
Aug 7 '08 #1
4 1856
coolsti
310 100+
Try to be more specific: Do you want to limit a user from entering more than 30 records at one time? Or do you want to limit a user from entering more than 30 records in total?

If the first is the case, then you can enforce the limitation using Javascript on your page by disallowing the entry fields to accept more than 30 entries.

If the second is the case, you can have the PHP scripts query the database for that user to see how many records have already been entered, and if there already are 30 records, the user can be denied access to the input fields to add new records.
Aug 7 '08 #2
ghjk
250 100+
Try to be more specific: Do you want to limit a user from entering more than 30 records at one time? Or do you want to limit a user from entering more than 30 records in total?

If the first is the case, then you can enforce the limitation using Javascript on your page by disallowing the entry fields to accept more than 30 entries.

If the second is the case, you can have the PHP scripts query the database for that user to see how many records have already been entered, and if there already are 30 records, the user can be denied access to the input fields to add new records.

I want to limit a user from entering more than 30 records in total. Database should allow to enter 30 records only.
Aug 7 '08 #3
coolsti
310 100+
I assume that your PHP scripts know who the user is, by means of the user log on ID which is probably stored in as a SESSION variable or somewhere. So when the page is requested which presents the user with the input forms for these records, the script that serves this page should first query the database for how many records this user has already entered. If the number of records is 30, then you just have to have your script not send the input field to the user, but instead a message saying that the user has exceeded his/her limit.
Aug 7 '08 #4
coolsti
310 100+
Actually, what I just wrote in my last reply probably is not robust enough.

Since the user may be able to use the browser back button or refresh button to show once again the input page even if he/she has already entered 30 posts (assuming you do not have any checks for this situation) then you should also do the following:

When a user submits an entry, the database should be queried to see how many entries that user already has entered, and if the number is 30, then the insert query should not be processed and instead the user should be presented with a message saying he/she has entered the maximum already.
Aug 7 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Randell D. | last post by:
Folks, I have a SELECT that returns with multiple records - It works when I have a LIMIT clause but when I try to include a GROUP BY clause, the select returns nothing (ie no records, no...
2
by: Dalan | last post by:
I am finalizing an Access 97 db and need to decide was is the best method to limit the number of records one can enter in the demo version of same. The archives seem to be replete with many...
6
by: Hannu | last post by:
Hi. In the ldb file you can see the users of the mdb-file. If you open the mdb-file your machine and username will be written in the lbd- file. Allthough you close the mdb-file your name won't...
3
by: deko | last post by:
Is there any way to limit the number of records loaded into a ListBox? I looked at qdf.MaxRecords (to apply to the query that is the RowSource of the ListBox) but that only applies to ODBC data...
4
by: Melson | last post by:
Hi I've a problem. Can anyone help. I would like to use datagrid for data entry. How can I set the number of rows in the datagrid. And use the datagrid to update the ms sql table. regards...
2
by: OM | last post by:
I have two tables, one with categories in it, and only 3 records - Wages, Salary, Contract. I have a second table that records hours and numbers of employees in each category, per month. How do...
2
by: VWoody12 | last post by:
Access 97: I have form that is has a sub-form embeded in it, I would like to limit the number of records that the user can enter into the sub-form to 5 entries. Is this possible? If so, how? Thanks...
1
by: dfw1417 | last post by:
I have used a query and report filter to return records related to a specific account id. I want to print a report including only the latest 6 records out of the set returned by the record filter. I...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.