Welcome Guest, Not a member yet? Register   Sign In
Questions regarding <dl> in CI.
#11

[eluser]obiron2[/eluser]
If your array is only 2 levels deep, you may find it easier to fetch the years from the database into an array using a SELECT DISTINCT
and then append the event data into each array element using another db query with the year as a filter.

It may not be faster, as you have had to make three trips to the db server rather than one, but the data manipulation should really be done at the db level rather than at the PHP level. I'm not sure what the performance difference would be if you had say 5 years and 50,000 events - I would suspect that at some point multiple trips to the db would be faster than manipulating large arrays in PHP

another alternative would be to return a flat data set, properly sorted and then chuck out a DL tag on change of year, this way you don't have to manipulate the data set and you only have one query, the only issue is that you would have redundant data in the results set.


Obiron


Messages In This Thread
Questions regarding <dl> in CI. - by El Forum - 09-03-2009, 02:41 PM
Questions regarding <dl> in CI. - by El Forum - 09-03-2009, 04:21 PM
Questions regarding <dl> in CI. - by El Forum - 09-03-2009, 06:44 PM
Questions regarding <dl> in CI. - by El Forum - 09-03-2009, 11:43 PM
Questions regarding <dl> in CI. - by El Forum - 09-04-2009, 01:40 AM
Questions regarding <dl> in CI. - by El Forum - 09-04-2009, 01:46 AM
Questions regarding <dl> in CI. - by El Forum - 09-04-2009, 02:10 AM
Questions regarding <dl> in CI. - by El Forum - 09-04-2009, 02:12 AM
Questions regarding <dl> in CI. - by El Forum - 09-04-2009, 02:19 AM
Questions regarding <dl> in CI. - by El Forum - 09-04-2009, 03:10 AM
Questions regarding <dl> in CI. - by El Forum - 09-04-2009, 05:38 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 02:30 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 05:38 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 05:51 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 06:24 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 06:58 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 08:11 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 11:05 AM
Questions regarding <dl> in CI. - by El Forum - 09-07-2009, 05:08 PM
Questions regarding <dl> in CI. - by El Forum - 09-08-2009, 12:45 AM
Questions regarding <dl> in CI. - by El Forum - 09-08-2009, 01:04 AM
Questions regarding <dl> in CI. - by El Forum - 09-08-2009, 03:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB