This code now causes a sql problem after the 2.1 install and database update.
Found http://codex.wordpress.org/Creating_an_Archive_Index
Snippet:
- Archives
<?php
$years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC");
foreach($years as $year) : ?>- "><?php echo $year; ?>
<?php endforeach; ?>
Error message:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY cat_name ASC' at line 1]
SELECT cat_id, cat_name FROM ORDER BY cat_name ASC