Grant

South Africa

Oct
17
accepted How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
Oct
17
comment How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
Adding the missing $ did the trick. Thanks for your solution, MUCH easier, simpler than my foreach longhand!
Oct
17
comment How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
So in the first iteration / loop the $activeSeasonId changes from null to the first $row->seasonID and prints out a closing </ul> | How do I fix that?
Oct
17
comment How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
if($activeSeasonId != $row->seasonID) { if(activeSeasonId != null) { echo "</ul>\n\n"; } echo "<ul>\n"; $activeSeasonId = $row->seasonID; }
Oct
17
comment How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
OK it works great, one problem: I have a hanging </ul> at the start.
Oct
17
comment How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
I see what you are saying nice and simple, will try it out now.
Oct
17
comment How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
Sorry, you are correct ignore my comment.
Oct
17
comment How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
I cannot do a join as this is all from one table
Oct
17
revised How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
added 261 characters in body
Oct
17
awarded Custodian
Oct
17
revised How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
added 2431 characters in body
Oct
17
revised How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
added 2431 characters in body
Oct
17
reviewed Approve suggested edit on How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
Oct
17
asked How can I do this in one MySQL Select query, I want to lose the foreach loop and the second select query?
Sep
30
awarded Explainer
Aug
3
accepted How do I Inner join my calendar_table to get full range of calendar dates + my query result from other_table
Aug
3
comment How do I Inner join my calendar_table to get full range of calendar dates + my query result from other_table
Last question: Why did you add act after LEFT JOIN activity? and cal after SELECT cal.dt, aveHR, duration, date FROM calendar? Works fine without these, aliases?
Aug
3
comment How do I Inner join my calendar_table to get full range of calendar dates + my query result from other_table
Works perfectly! Thanks so much!
Aug
3
comment How do I Inner join my calendar_table to get full range of calendar dates + my query result from other_table
OK awesome! Seems to work except my activity.date format is: 2014-08-02 11:08:24 and my calendar dt format is: 2014-08-02 - I tried: substr(activity.date,0,10) but it's giving me NULL values for date
Aug
3
revised How do I Inner join my calendar_table to get full range of calendar dates + my query result from other_table
added 9 characters in body
1 2 3 4 5