In PHP, I wrote a php function in controller getItems, to get all the items when I call through ajax using javascript/jquery. I am passing a param limit to limit the items to get from server.
This works fine but how to use the same method to get all the items? Currently, the below query is working if and only if I provide limit param value.
"SELECT DISTINCT name, id from TABLE_NAME
ORDER BY shared_date DESC
LIMIT @~~limit~~@";
How to get all the items by modifying the same query?
Currently, I am solving this by having two different queries, one with limit and other without limit. (which I feel messy)