Date: 07/16/02
- Next message: Adam Alkins: "Re: [PHP-DB] Keeps prompting to download php page???"
- Previous message: NIPP, SCOTT V (SBCSI): "[PHP-DB] Keeps prompting to download php page???"
- Next in thread: Beau Lebens: "RE: [PHP-DB] change data before its sent to db?"
- Maybe reply: Beau Lebens: "RE: [PHP-DB] change data before its sent to db?"
- Reply: Tomator: "[PHP-DB] Re: change data before its sent to db?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have a form with a select box of the 12 months + one for none. It (and
more) are sent to a mysql
database. On another web page a list is displayed and can be sorted by
date, but of course
the month names are not alphabetical. I tried to assign each month a
number, 01,02,03, etc in a
if-elseif statement, then send it to the database but that wouldn't work.
if ($month == 'jan') { $month = '01';}
elseif ($month == 'feb') {$month = '02'};
etc, so I can then sort numerically, and it will display in the correct
order on the web page.
I have tried various versions of the above but it will not work.
I know I could use numbers instead of names for the months - but for this
application that
would not be appropriate.
The sort code ---
if ($orderby == 'month_num'):
$sql = "select * from releases order by 'month'";
elseif ($orderby == 'month_num2'):
$sql = "select * from releases order by 'month' desc";
The html select ----
<td valign="bottom">Month:<br />
<select name="month">
<option value="000">None
<option value="Jan">Jan
<option value="Feb">Feb
etc
</select>
-- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com chip.wiegand <email protected>"There is no reason anyone would want a computer in their home." --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (They why do I have 9? Somebody help me!)
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Adam Alkins: "Re: [PHP-DB] Keeps prompting to download php page???"
- Previous message: NIPP, SCOTT V (SBCSI): "[PHP-DB] Keeps prompting to download php page???"
- Next in thread: Beau Lebens: "RE: [PHP-DB] change data before its sent to db?"
- Maybe reply: Beau Lebens: "RE: [PHP-DB] change data before its sent to db?"
- Reply: Tomator: "[PHP-DB] Re: change data before its sent to db?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

