Welcome Guest, Not a member yet? Register   Sign In
Result and Sort by Date
#5

(09-03-2019, 01:55 AM)incognitorecon Wrote: Any idea ?

You are making 3 separate request, that's why the order is not what you expect. I can think of 2 ways to fix this: 

1. Combine your 3 select query in a single one with UNION and add an order by for the results returned by all 3 selects.
Example: https://stackoverflow.com/questions/4374...nion-mysql

2. Combine the results of your 3 select in a single array, and sort this new array, maybe with usort, depending on the content: https://www.php.net/usort
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
Result and Sort by Date - by incognitorecon - 09-03-2019, 01:55 AM
RE: Result and Sort by Date - by dave friend - 09-03-2019, 11:57 AM
RE: Result and Sort by Date - by incognitorecon - 09-03-2019, 05:50 PM
RE: Result and Sort by Date - by php_rocs - 09-04-2019, 08:06 AM
RE: Result and Sort by Date - by includebeer - 09-04-2019, 09:47 AM
RE: Result and Sort by Date - by dave friend - 09-04-2019, 10:28 AM
RE: Result and Sort by Date - by includebeer - 09-04-2019, 12:42 PM
RE: Result and Sort by Date - by dave friend - 09-04-2019, 02:57 PM
RE: Result and Sort by Date - by includebeer - 09-05-2019, 10:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB