Re: change data before its sent to db?
| From: | Tomator | Date: | Wed, 17 Jul 2002 08:27:14 +0000 |
| Subject: | Re: change data before its sent to db? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20589@lists.php.net to get a copy of this message | ||
You will laugh. When you quote month, you don't sort date by month field.
You sort by "month" - text constant being always equal. In fact you son't
sort it at all!
> 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";
Try this:
$sql = "select * from releases order by month";