Re: [PHP] selecting current month from a database

2006-05-22 Thread Richard Lynch
On Sun, May 21, 2006 1:45 am, Paul Goepfert wrote: > I know this might be trivial problem but I can't seem to figure it > out. Here is my problem I have a drop down menu where I have the > months of year as menu items. I want to be able to have the current > month be the selected month. I have t

RE: [PHP] selecting current month from a database

2006-05-22 Thread Ford, Mike
On , [EMAIL PROTECTED] wrote: > I see Paul N. solved your selection problem. But I'm wondering > why you need to store month names in a database. You could > get them using date() and mktime() and avoid a db hit: > > foreach (range(1, 12) as $i) { > echo date('F', mktime(0, 0, 0, $i)); >

Re: [PHP] selecting current month from a database

2006-05-22 Thread Rabin Vincent
On 5/21/06, Paul Goepfert <[EMAIL PROTECTED]> wrote: Hi all, I know this might be trivial problem but I can't seem to figure it out. Here is my problem I have a drop down menu where I have the months of year as menu items. I want to be able to have the current month be the selected month. I h

RE: [PHP] selecting current month from a database

2006-05-22 Thread Paul Novitski
At 06:32 AM 5/22/2006, Jef Sullivan wrote: $cur_month = date("m"); while ($r = mysql_fetch_array($month_query)) { $v = $r["m_id"]; $out = $r["months"]; if( $cur_month = $v ) { echo("".$out."") } } You're definitely saving some

RE: [PHP] selecting current month from a database

2006-05-22 Thread Jef Sullivan
al Message- From: Paul Novitski [mailto:[EMAIL PROTECTED] Sent: Sunday, May 21, 2006 2:55 AM To: php-general@lists.php.net Subject: Re: [PHP] selecting current month from a database At 11:45 PM 5/20/2006, Paul Goepfert wrote: >I have a drop down menu where I have the >months of year as menu ite

Re: [PHP] selecting current month from a database

2006-05-21 Thread Paul Novitski
At 11:45 PM 5/20/2006, Paul Goepfert wrote: I have a drop down menu where I have the months of year as menu items. I want to be able to have the current month be the selected month. I have tried using the date function as the way to set the current month as the selected value but it seems that

[PHP] selecting current month from a database

2006-05-20 Thread Paul Goepfert
Hi all, I know this might be trivial problem but I can't seem to figure it out. Here is my problem I have a drop down menu where I have the months of year as menu items. I want to be able to have the current month be the selected month. I have tried using the date function as the way to set th