Limit the number of rows in the table
Limit the number of rows in the table
Hello,
For example,
I have a table, where will be many data.
It also have foreign-key "id_example".
In my Editor-handler i use WHERE clause to filter data from it.
->where($key = 'example.id_example', $value=$myvalue)`
I need to restrict user create new records, if row count = 1.
Any suggestions?
This discussion has been closed.
Answers
Have you read the sticky?
http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
Would need a lot more details to really be able to help you.
So the Editor PHP libraries themselves won't perform the
if row count = 1, then allow create
restriction for you. You would need to implement that logic yourself.Something like:
Obviously you'll need to get
$row_count
from wherever you have that information (presumably in the database, so make a query to get it).Allan
Works very well, thank you, Allan.