General Community > Scripting Help
crazy mySQL question
(1/1)
Aquilo:
is it possible to do this in mySQL?
((month)(year)) != ({$month.$year})
what I would like to do is make ((month)(year)) like 112003 and compare it to ({$month.$year}) to see that there not the same.
is this actually possible?
Aquilo:
never mind! this would be good to know but all I had to do was match it like I did the days and months and the year feel in place!
Aquilo:
ok still not working! :(
would anyone have a sugestion on how to make this right? it's the year that is giving me a headach of I leave the year out it returns next years dates and with it, it will not return any thing if asked to get past the end of this year!
thanks for any suggestions!
--- Code: ---$weeks = 11;
$f = mktime(0,0,0,$month, $day+(7*$weeks), $year);
$fday = date('d',$f);
$fmonth = date('m',$f);
$fyear = date('Y',$f);
$holidays_query = mysql_query("
SELECT title, day, month, year
FROM {$db_prefix}calendar_holiday
WHERE (month BETWEEN '{$month}' AND '{$fmonth}')
AND (day BETWEEN '{$day}' AND '{$fday}')
AND (year BETWEEN '{$year}' AND '{$fyear}')
ORDER BY day DESC, month DESC, year DESC");
--- End code ---
[Unknown]:
Soemthing like...
WHERE CONCAT(month, year) != '{$month.$year}'
But why do you want to do that?
-[Unknown]
Aquilo:
I want to select the holidays within a time frame from the database.
Navigation
[0] Message Index
Go to full version