On 8/8/07, Justin Giboney <[EMAIL PROTECTED]> wrote: > In my current mysql db, i have 3 fields one for the day, one for the > month, and one for the year. I need to compare them to the current date. > > This is the code I have so far, but it doesn't work. > > $sql = "SELECT * FROM Movies WHERE CURDATE() > (DVD_Release_Year, > DVD_Release_Month, DVD_Release_Day) AS theDate LIMIT 0,7";
Probably something like: SELECT * FROM movies WHERE CURRENT_DATE > CAST (dvd_release_year || '-' || dvd_release_month || '-' || dvd_release_day AS DATE) LIMIT 0,7 CURRENT_DATE is part of the SQL standard and is an alias for CURDATE(). I prefer using standard constructs whenever I can. -Roberto _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
