Title: php error_log showing SELECT SQL_CALC_FOUND_ROWS
Last modified: August 30, 2016

---

# php error_log showing SELECT SQL_CALC_FOUND_ROWS

 *  [hrtliah](https://wordpress.org/support/users/hrtliah/)
 * (@hrtliah)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/php-error_log-showing-select-sql_calc_found_rows/)
 * My php error_log keep showing this message,
    `WordPress database error Unknown
   column 'wp_postmeta.meta_value' in 'order clause' for query SELECT SQL_CALC_FOUND_ROWS
   wp_posts.ID FROM wp_posts WHERE 1=1 AND 0 GROUP BY wp_posts.ID ORDER BY wp_postmeta.
   meta_value+0 DESC, wp_posts.post_date DESC LIMIT 0, 10 made ​​by require ('wp-
   blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->
   get_posts`
 * I never change something in my database. Anyone knows something bout this? If
   it something about theme, I’m using bazar theme.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [juggledad](https://wordpress.org/support/users/juggledad/)
 * (@juggledad)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/php-error_log-showing-select-sql_calc_found_rows/#post-6785147)
 * the problem is the part ‘ORDER BY wp_postmeta.meta_value+0’ – note the ‘+0’ –
   that is messing things up.
 * If you are using the Bazar Shop theme you should contact the theme author since
   that is a premimum theme and we do not have access to it.
 *  Thread Starter [hrtliah](https://wordpress.org/support/users/hrtliah/)
 * (@hrtliah)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/php-error_log-showing-select-sql_calc_found_rows/#post-6785203)
 * Thank you for explaining juggledad,
 * so, it’s really about the theme? because i do update bazar theme before this 
   start happen. Can you really explain what about the `'ORDER BY wp_postmeta.meta_value
   +0'` because i’m still new with this..
 *  [juggledad](https://wordpress.org/support/users/juggledad/)
 * (@juggledad)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/php-error_log-showing-select-sql_calc_found_rows/#post-6785219)
 * Looking at the SQL again, I realized I was wrong. I beleive the problem is that
   the select is taking place only on the ‘wp_posts’ table, but it is referencing
   a column (wp_postmeta.meta_value) that is in the ‘wp_postsmeta’ table.
 * You can check if it is theme relaed by swapping to a diferent theme and seeing
   is the same issue shows up. If it does, then it is NOT a theme issue but it it
   doesn;’t then it IS a theme issue and you need to talk to the theme author.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘php error_log showing SELECT SQL_CALC_FOUND_ROWS’ is closed to new replies.

## Tags

 * [Bazar](https://wordpress.org/support/topic-tag/bazar/)
 * [errorlog](https://wordpress.org/support/topic-tag/errorlog/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [juggledad](https://wordpress.org/support/users/juggledad/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/php-error_log-showing-select-sql_calc_found_rows/#post-6785219)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
