Hi, I am wondering if it is possible to write a query that inserts data as long as there are less than N duplicates.
For example, I have a game where I want a user to be able to submit no more than 10 entries. I don't want to check this constraint in PHP code because there is a possibility of problems when a user tries to insert from multiple machines. Basically, I'd like to write a query that says something like:
INSERT INTO mytable (field1,field) VALUES(1,2) WHERE there are less than 10 entries with field1=1 and field=2. Is this possible?
Thanks,
Jeff
For example, I have a game where I want a user to be able to submit no more than 10 entries. I don't want to check this constraint in PHP code because there is a possibility of problems when a user tries to insert from multiple machines. Basically, I'd like to write a query that says something like:
INSERT INTO mytable (field1,field) VALUES(1,2) WHERE there are less than 10 entries with field1=1 and field=2. Is this possible?
Thanks,
Jeff