Comments (8)
If you want the oldest records you need to sort in descending order. It you want to present these in your front end in ascending order then you should reverse the array after receiving it. Does that help?
from php-crud-api.
yes.. this is done using a combination of the "page" and "order" parameter (you must use both):
GET http://localhost/api.php/shopping_cart_products?order=id,desc&page=1,10
Like that, is that clear?
from php-crud-api.
Yes this combination it's ok for limit the query in order descending but if you want order by date and order ascending for example:
GET http://localhost/api.php/shopping_cart_products?order=created,asc&page=1,20
This call return the 20 oldest products but no the last 20 products ordered by date, or I'm wrong with this?
Thanks for your help @mevdschee
from php-crud-api.
Oh ok it's true, i can reverse the array this way. I thought that the API could bring me this already ordered.
Thank for your help!
from php-crud-api.
It does not because it is not included in SQL and the API is streaming the data, not keeping it in memory for reordering before sending it out. Kind regards, Maurits
from php-crud-api.
What! This api doesn't allow to get desc sorted with pagination?
You mean to achieve this we have to get all data without pagination and
then reverse it in local?
-Bhavesh
On Mar 16, 2016 10:13 PM, "Radigar" [email protected] wrote:
Oh ok it's true, i can reverse the array this way. I thought that the API
could bring me this already ordered.Thank for your help!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#41 (comment)
from php-crud-api.
No, that is not true. You can get the data with pagination, but have to reverse it local (if you want to present it in another order than the order that you have retrieved it in).
from php-crud-api.
Does this make things clear? Can I close this issue now?
from php-crud-api.
Related Issues (20)
- Filter results if joined table has an authorization.recordHandler HOT 3
- HTML Middleware HOT 2
- Update with "where" HOT 8
- "Request Tranformer" middleware HOT 2
- Azure App Service HOT 1
- Add PHP backend to any app project with one command HOT 1
- Any advice on events integration? HOT 2
- Synchronization between local IndexedDB and MySQL Database. HOT 3
- Can the API Support Customized Cache Management for Specific Tables? HOT 9
- Question: Add property on create HOT 3
- Insights on caching with Redis HOT 2
- Using Customization handler to insert app-generated ID HOT 11
- PUT using curl comes back successful but the record is not actually updated HOT 2
- Suggestion to modify response JSON root Key (records) HOT 2
- firebase jwt public key rotation HOT 5
- "Route '' not found" HOT 3
- Additional SQL queries in authorization handlers HOT 2
- Direct usage of PHP CRUD API functions in external PHP Files HOT 8
- Failure on postgres when table name is domains HOT 10
- Returning user uploaded file using custom controller HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-crud-api.