Title: SQL SELECT Error
Last modified: August 20, 2016

---

# SQL SELECT Error

 *  [joejozwowski](https://wordpress.org/support/users/joejozwowski/)
 * (@joejozwowski)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/sql-select-error/)
 * If there is no media in a category, and you call said category on a page, you
   get the following error:
 * `Error!SELECT p.*, a.term_order FROM wp_posts p inner join wp_term_relationships
   a on a.object_id = p.ID inner join wp_term_taxonomy ttt on ttt.term_taxonomy_id
   = a.term_taxonomy_id inner join wp_terms tt on ttt.term_id = tt.term_id where
   ttt.taxonomy='media_category' && tt.term_id=15 order by a.term_order asc`
 * _**15 is the media category ID**_
 * Shouldn’t it just not display anything? How can I modify the shortcodes.php to
   resolve this issue. I am using v1.0.8 of this plugin.

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

 *  Thread Starter [joejozwowski](https://wordpress.org/support/users/joejozwowski/)
 * (@joejozwowski)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/sql-select-error/#post-2273375)
 * **A TEMPORARY FIX**
 * If you look in the shortcodes.php file, you should see the following on line 
   63
 * `echo "Error!".$wpdb->print_error().$query;`
 * change this to:
 * `echo "";`
 * No More Error message.
 * I do like the fact that the code will alert you if there is nothing in the query,
   but COME ON… that wpdb print error message is extremely verbose!
 *  Plugin Author [merganser](https://wordpress.org/support/users/merganser/)
 * (@merganser)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/sql-select-error/#post-2273728)
 * i will remove this for the next version.
    thanks!
 *  Plugin Author [merganser](https://wordpress.org/support/users/merganser/)
 * (@merganser)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/sql-select-error/#post-2273729)
 * commented out in 1.1.1

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

The topic ‘SQL SELECT Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/media-library-categories.svg)
 * [Media Library Categories](https://wordpress.org/plugins/media-library-categories/)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-categories/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-categories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-categories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-categories/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [merganser](https://wordpress.org/support/users/merganser/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/sql-select-error/#post-2273729)
 * Status: not resolved