Title: WordPress database error &#8211; SQL syntax
Last modified: August 18, 2016

---

# WordPress database error – SQL syntax

 *  [josephus](https://wordpress.org/support/users/josephus/)
 * (@josephus)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax/)
 * Hello. I have upgraded to 2.1 and I am getting an error where my links and blogroll
   are supposed to be.
    MYSQL version 4.1.21-standard-log PHP version 4.4.4 Here’s
   the error: 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 ‘ASC’ at line 1] SELECT * FROM wp_categories WHERE cat_ID > 0 AND
   link_count > 0 ORDER BY cat_id- ASC
 * Anyone know what I can do? I don’t even know which file contains this code.
    
   Thanks. Joe

Viewing 1 replies (of 1 total)

 *  Thread Starter [josephus](https://wordpress.org/support/users/josephus/)
 * (@josephus)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax/#post-524720)
 * Two hours later: I fixed it by checking it against the sidebar file from another
   theme.
    I replaced this: `<?php get_links_list('id-'); ?>` with this: `<?php 
   get_links_list(); ?>` Then the error went away and all my links came back. Joe

Viewing 1 replies (of 1 total)

The topic ‘WordPress database error – SQL syntax’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 1 reply
 * 1 participant
 * Last reply from: [josephus](https://wordpress.org/support/users/josephus/)
 * Last activity: [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-sql-syntax/#post-524720)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
