I am hoping you can help me out with my querying and displaying results in while loop.
I stumbled upon several similar questions such as this one and although it kind of answers my question it also kind of not.
I have following query:
(SELECT dt_id, DATE_FORMAT(dt_date, '%m-%d-%Y') as dt_date,
dt_data, dt_bodypart, dt_wktype, dt_wkurl, dt_year,
COUNT(*) as Total
FROM data
WHERE dt_year = '2015'
and dt_username_member = 'admin'
GROUP BY dt_date
ORDER BY dt_date DESC
LIMIT 0,100)
ORDER BY dt_date ASC
Which displays rows by date and group them by date as well since my array that handles results cannot display more than 1 results in calendar if same date appears twice. I also count how many records are for each date.
I actually can make it to work as I like by running query inside of a while loop (which is bad practice) but I would like to avoid that and do it in more efficient and better way
Can't work with results like this as my array will only display one result on calendar page (most recent one added to db) :
array {
'08-26-2015' : 'something',
'08-26-2015' : 'something else',
'08-27-2015' : 'else',
}
Currently I have this but also I am running query in while loop if count of records for that date is > 1 and I would like to achieve this very same result but without running query for records with count > 1 inside of a while loop
array {
'08-26-2015' : 'something, something else',
'08-27-2015' : 'else',
}