Title: WordPress 3.5 Admin Error
Last modified: August 20, 2016

---

# WordPress 3.5 Admin Error

 *  Resolved [Jeff Lambert](https://wordpress.org/support/users/lambje/)
 * (@lambje)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/)
 * The following is being thrown in the Admin area after upgrading to WordPress 
   3.5. Running latest version of category icon plugin. Not seeing an issue on the
   front end as yet.
 * Warning: Missing argument 2 for wpdb::prepare(), called in /home/webphysi/public_html/
   wpb/wp-content/plugins/category-icons/category_icons.php on line 1047 and defined
   in /home/webphysi/public_html/wpb/wp-includes/wp-db.php on line 990
 * [http://wordpress.org/extend/plugins/category-icons/](http://wordpress.org/extend/plugins/category-icons/)

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/wordpress-35-admin-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-35-admin-error/page/2/?output_format=md)

 *  [maxwelton](https://wordpress.org/support/users/maxwelton/)
 * (@maxwelton)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260147)
 * I see the same error, just so you know it’s not a one-off thing.
 *  [maxwelton](https://wordpress.org/support/users/maxwelton/)
 * (@maxwelton)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260153)
 * It looks like a few “prepare” calls throughout the plugin need to be modified,
   not just that one instance.
 * If you want to edit the plugin yourself to work as it was before until an update
   comes out, the following seems to work–no guarantees. I have not added or deleted
   any icons since making this mod, I just wanted my admin area and public-facing
   pages to not show the error(s).
 * Line 1047, add “,0” right before the final two parens:
 * `$wpdb->query($wpdb->prepare("CREATE TABLE IF NOT EXISTS`$wpdb->ig_caticons`(`
   cat_id`INT NOT NULL ,`priority`INT NOT NULL ,`icon`TEXT NOT NULL ,`small_icon`
   TEXT NOT NULL , PRIMARY KEY (`cat_id`))",0));`
 * Line 1338, add “,0” similarly:
 * `$datas = $wpdb->get_results($wpdb->prepare("SELECT cat_id, priority, icon, small_icon
   FROM $wpdb->ig_caticons",0));`
 *  Thread Starter [Jeff Lambert](https://wordpress.org/support/users/lambje/)
 * (@lambje)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260158)
 * [@maxwelton](https://wordpress.org/support/users/maxwelton/) – Appreciate the
   above as I hadn’t spent a lot of time looking at it yet. Now that I do the prepare
   probably isn’t necessary as there aren’t any parms in the SQL. Looks like the
   other uses of prepare aren’t always setting it up as you would expect either.
 * I did make the two noted changes and the warning is gone. It also cleared up 
   a warning on another plugin that was around headers being sent. Probably a result
   of the first warning being sent.
 * Thanks!
 *  [dougjoseph](https://wordpress.org/support/users/dougjoseph/)
 * (@dougjoseph)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260185)
 * [@maxwelton](https://wordpress.org/support/users/maxwelton/)
 * Thanks! I had the same issue, and the fix you listed worked.
 *  [John Robert-Nicoud | 6clicks](https://wordpress.org/support/users/jerboa/)
 * (@jerboa)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260188)
 * [@maxwelton](https://wordpress.org/support/users/maxwelton/) thank’s a lot ….
   seems to work …
 *  [Winock123](https://wordpress.org/support/users/winock123/)
 * (@winock123)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260211)
 * [@maxwelton](https://wordpress.org/support/users/maxwelton/)
 * Here the same, Thank´s a lot !
 *  [jorgeorpinel](https://wordpress.org/support/users/jorgeorpinel/)
 * (@jorgeorpinel)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260219)
 * Glad to see a solution has been posted. [@maxwelton](https://wordpress.org/support/users/maxwelton/)’
   s tip is incomlpete however. There’s several lines that need to be changed in
   the file.
 * For a complete fix please update category_icons_php with this file I bug-fixed:
   [https://docs.google.com/open?id=0B7JEImS_HANHVlRzNnJrb3E2QVU](https://docs.google.com/open?id=0B7JEImS_HANHVlRzNnJrb3E2QVU)
 *  Thread Starter [Jeff Lambert](https://wordpress.org/support/users/lambje/)
 * (@lambje)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260231)
 * FYI – Posting the official commentary on this and how to address it. This is 
   mainly meant for the plugin author, [@submarine](https://wordpress.org/support/users/submarine/),
   but may be interesting to others. And known to some that already have responded.
 * > [PHP Warning: Missing argument 2 for wpdb::prepare()](https://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/)
 *  [allstone](https://wordpress.org/support/users/allstone/)
 * (@allstone)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260237)
 * The google doc that jorgeopinel posted isn’t allowing a select-all, copy and 
   paste.
 *  [allstone](https://wordpress.org/support/users/allstone/)
 * (@allstone)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260238)
 * I made the two changes that @ maxwelton listed, and the errors are no longer 
   appearing at the top of the page on the frontend or messing up the admin-backend.
   However in the category view, I get the following error above the graphic that
   is now correctly displaying:
 * `Warning: Missing argument 2 for wpdb::prepare(), called in /usr/www/users/taurus/
   gancao/wp-content/plugins/category-icons/category_icons.php on line 1360 and 
   defined in /usr/www/users/taurus/gancao/wp-includes/wp-db.php on line 990`
 *  [allstone](https://wordpress.org/support/users/allstone/)
 * (@allstone)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260239)
 * Ha! I just added the `,0` to the end of line 1360 (like the two other edits above)
   and the whole thing works perfectly now.
 *  [baco99](https://wordpress.org/support/users/baco99/)
 * (@baco99)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260240)
 * Hello allstone, I have the same problem, please can you tell me where is the 
   1360 line? I can’t find where to add ,0
 *  [allstone](https://wordpress.org/support/users/allstone/)
 * (@allstone)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260241)
 * Hi Baco99, you’ll want to modify the file called “category_icons.php”. Most text
   editing programs provide the ability to display and even jump to a given line
   number, however lacking that, search for this:
    if ($row = $wpdb->get_row($wpdb-
   >prepare(“SELECT cat_id, priority, icon, small_icon FROM $wpdb->ig_caticons WHERE
   cat_id IN($instr) ORDER BY priority DESC LIMIT 1”)))
 * Change it to this:
    if ($row = $wpdb->get_row($wpdb->prepare(“SELECT cat_id, 
   priority, icon, small_icon FROM $wpdb->ig_caticons WHERE cat_id IN($instr) ORDER
   BY priority DESC LIMIT 1”,0)))
 *  [danbp](https://wordpress.org/support/users/danbp/)
 * (@danbp)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260242)
 * Hi guys,
 * sorry to say that, but you’re wrong !
    Because 0 means… zero, you can’t give “
   nothing” as second argument.
 * For sure, the warning disapear, because “something” is placed as second, but 
   this “something” is empty. So the query is already wrong.
 * read attentively the doc [http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/](http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/)
 * None of the examples are telling about 0, but $arg.
 * So, IMO, this example
    `if ($row = $wpdb->get_row($wpdb->prepare("SELECT cat_id,
   priority, icon, small_icon FROM $wpdb->ig_caticons WHERE cat_id IN($instr) ORDER
   BY priority DESC LIMIT 1")))`
 * should be
 * `if ($row = $wpdb->get_row($wpdb->prepare("SELECT cat_id, priority, icon, small_icon
   FROM $wpdb->ig_caticons WHERE cat_id IN($instr) ORDER BY priority DESC LIMIT 
   1", $cat_id, $priority, $icon, $small_icon)))`
 *  Plugin Author [TheSubmarine](https://wordpress.org/support/users/submarine/)
 * (@submarine)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/wordpress-35-admin-error/#post-3260274)
 * I’ve published [the 2.2.6 version](http://downloads.wordpress.org/plugin/category-icons.2.2.6.zip),
   if someone want to test it, please.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/wordpress-35-admin-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-35-admin-error/page/2/?output_format=md)

The topic ‘WordPress 3.5 Admin Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/category-icons_a5a28b.svg)
 * [Category Icons](https://wordpress.org/plugins/category-icons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/category-icons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/category-icons/)
 * [Active Topics](https://wordpress.org/support/plugin/category-icons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/category-icons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/category-icons/reviews/)

 * 17 replies
 * 11 participants
 * Last reply from: [Palpatine1976](https://wordpress.org/support/users/palpatine1976/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/wordpress-35-admin-error/page/2/#post-3260291)
 * Status: resolved