Hello people…
Just a quick one to pick your minds, i know this isnt too complex but i just cant get a solution.
Anyway. Using php and mysql i have a simple table of upcoming events.
These events are stored nicely and the date is in the proper date field (0000 00 00)
When the website user visits my page they simply have to enter a month to have displayed everything that is going on in that month in ascending order.
The query i am using (which seems to works ok) is this.
[code=php]
$SQL = “SELECT name, DATE_FORMAT(date,’%D %M %Y’) AS print_date, location, telephone, email, extra, description FROM events WHERE MONTH(date) = ‘$month’ AND date >=CURDATE() ORDER BY date ASC LIMIT 100”;
$result = mysql_query( $SQL );
while( $row = mysql_fetch_array( $result ) ) {
$name = $row[“name”];
$date = $row[“print_date”];
$location = $row[“location”];
$telephone = $row[“telephone”];
$email = $row[“email”];
$extra = $row[“extra”];
$description = $row[“description”];
?>
Now my query is this, when the user has entered the month they desire and hit submit on the page that comes from the above query along with the actual results i would like to have a quick note just stating that a certain month is being displayed.
i.e Upcoming event for month (jan, feb, marc, etc.etc)
Now if i put in a simple
[code=php]<?php echo $month;?>
then it will be displayed as a number 01,02,03 — 12. As this is how it is stored in mysql.
So my question is how can i have this displyed again as a real date.
I know this is blindingly obvious as i can display the full date through the above query ok, but to display just the month as a month is a pain for me.
thanks in advance for any replies.
Bolty2uk