Page 2 of 2
Re: Need help with array
Posted: Sun Feb 05, 2012 7:30 am
by Celauran
Rovch wrote:Actually you're right, however what initially changes 'is_show' in the table?
Can I completely get rid of 'is_show' and use something like:
Code: Select all
$month = $date("n");
return $db->query("SELECT DISTINCT month_id from travel WHERE month_id=".$month." ORDER BY 1 ".($parms['start'] == 12 ? 'DESC' : '')." ".$limit);
And hopefully not change anything else.
It's worth a try. I have no idea what sets is_show or where else it might be used; this isn't my code.
Re: Need help with array
Posted: Sun Feb 05, 2012 7:33 am
by Celauran
Rovch wrote:For some reason I can't get PHP to identify month number like this:
That should work assuming $date is a DateTime object.
Rovch wrote:Also, how would I go about getting two months instead of one out of this? So far I can only get one month to output properly.
Code: Select all
return $db->query("SELECT DISTINCT month_id from travel WHERE month_id=".$month." ORDER BY 1 ".($parms['start'] == 12 ? 'DESC' : '')." ".$limit);
Code: Select all
return $db->query("SELECT DISTINCT month_id from travel WHERE month_id >= ".$month." ORDER BY 1 ".($parms['start'] == 12 ? 'DESC' : '')." ".$limit);
Re: Need help with array
Posted: Sun Feb 05, 2012 8:05 pm
by Rovch
Celauran, thanks a lot for help. But I ended up writing my own code.
See, somehow 'is_show' is an algorithm that edits itself and shows three proper links.
Although each month has three. table only holds 24.. I am just going to end up bumping that up to 36.
It's too risky to mess with that class because I don't know if anything else relies on it.
Thanks a lot for help tho.