Result and Sort by Date |
(09-04-2019, 09:47 AM)includebeer Wrote: 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 I thought this might work too but it seems to me that the combined array has to sort by keys. A sort by value is - pardon the pun - of no value. (usort sorts on values) If we use dates for the keys we are limited to one date in the array. Maybe a UNION will work. UPDATE It seems a UNION will work. I used the query below in phpMyAdmin and got the desired results. The various "date" columns all use the "date" datatype. Code: SELECT DATE_FORMAT(`registerDate`, '%m-%d-%Y') AS 'Date',`registerStatus` AS 'Function',`registerUserName` AS 'Name' FROM `registerdata` WHERE `schoolID`=5 So that means only one query and resulting dataset, so the view only needs one foreach loop. |
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
|