How to Display MySQL Data by date field using PHP
Posted on 2009-06-27
I have a table which contains rows of data. One column is Date. I would like to learn how to display this data on a web page using PHP. That seems easy enough -- what I am struggling with is how to display the data filtered by date. For example, I only want to show the rows of data for events which are within two weeks from the current date. I also do not want to show past events.
I imagine the way to do this would be to use a select statement in SQL to display only those rows of data WHERE [DATE] is greater than [todays date] but less than [two eeks from now]. I probably also would need to build the rows on the fly using PHP each time the page loads, right?