I need to limit sellers to insert 10 rows only in my mysql table with paricular seller id?
Asked
Active
Viewed 57 times
-2
-
Can you elaborate on your question? How do you plan to use this table? Also, what is your app logic looking like? – Tim Biegeleisen Jan 10 '17 at 07:01
-
1To give you a great answer, it might help us if you have a glance at [ask] if you haven't already. It might be also useful if you could provide a [mcve]. – Mat Jan 10 '17 at 07:29
-
A join will usually suffice. – Strawberry Jan 10 '17 at 07:29
-
Is that 10 on 1 visit, 10 per day or 10 forever? – P.Salmon Jan 10 '17 at 09:51
-
10 for forever...Its like for 199 Rs,you can ads 10 posts,for 499-100ads etc.. – Edwin Jan 11 '17 at 04:58
1 Answers
0
It looks like you could get started here to limit rows for MySQL using triggers: How to limit number of the many in a one-to-many relationships between two tables?
Although, from my personal experience, it is a way better practice to place this limitation in your code that inserts the rows to the database than in the database itself. It will make everything a lot more manageable and eventually allow to change this limitation on a per-user basis.

Community
- 1
- 1

Marc-Antoine Parent
- 340
- 1
- 8