Skip to content

Conversation

@huangyifu
Copy link

Add function support in SELECT query:

SELECT COUNT(*) AS C FROM ATABLE

https://127.0.0.1/api.php/records/mytest/?include=count(*)%20AS%20c

@mevdschee
Copy link
Owner

mevdschee commented Mar 22, 2023

I'm not happy with the security implications of this issue, as I think it breaks access restrictions enforced by middleware, therefor I'm closing this PR.

Also, if you want to know the count then you can use a workaround:

GET /records/categories?order=id&page=1,1 

The JSON response will contain a "results" key with the count.

See: https://github.com/mevdschee/php-crud-api#pagination

@mevdschee mevdschee closed this Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants