![]() ![]() This would be the equivalent of the MONTH() function. The second query should display only the month value from the date. This would be the equivalent of the YEAR() function. The first query should only display the year value from the date. iddate 1 2 Let’s extract the year and the month from the date. Example: Our database has a table named dates with data in the columns id and date. Alternately, you can figure out what the date was a month ago with PHP (I'm not a PHP person, but I'm guessing DateTime::sub would help with that) and then include that date in your query in the normal way you would any other date/time field.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |