View Single Post
  #7 (permalink)  
Old Jan 12th, 2008, 19:58
dab42pat dab42pat is offline
SuperMember

SuperMember
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Monthly Archives using PHP/MySQL?

try adapting this code.

PHP: Select all

<?php  
$curr_month 
date("m");  
$month = array (1=>"January",  "February""March""April""May""June""July""August",  "September""October",  "November""December");  
$select "<select  name=\"month\">\n"
foreach  (
$month as $key => $val) { 
     
$select .= "\t<option  val=\"".$key."\""
    if  (
$key ==  $curr_month) { 
        
$select .=  " selected>".$val."\n"
    } else { 
        
$select .=  ">".$val."\n"
    } 

$select .=  "</select>"
echo 
$select;  
?>
hope it helps
Reply With Quote