Support » Plugin: Category Icons » Please modify your plugin for wpdb prepare

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m having the same problem. The error details are:

    Warning: Missing argument 2 for wpdb::prepare(), called in http://www.yourdomain.com/wp-content/plugins/category-icons/category_icons.php on line 1047 and defined in http://www.yourdomain.com/wp-includes/wp-db.php on line 992

    Lines 1045 to 1047 read
    function ig_caticons_install() {
    global $wpdb, $table_prefix;
    $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 ))”));

    Line 992 to 994 read
    function prepare( $query, $args ) {

    if ( is_null( $query ) )

    return;

    Same problem for me…

    Hello,

    I removed the prepare and it works fine, in the line 1047 I changed from this:

    $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 ))”));

    To this:

    $wpdb->query(“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 ))”);

    After doing that I got an error in the line 1338. So I changed from this:

    $datas = $wpdb->get_results($wpdb->prepare(“SELECT cat_id, priority, icon, small_icon FROM $wpdb->ig_caticons”));

    To this:

    $datas = $wpdb->get_results(“SELECT cat_id, priority, icon, small_icon FROM $wpdb->ig_caticons”);

    As in those cases the prepare seems not to be needed.

    Regards…

    Hi,

    Doesn’t work for me, it prevents from loading wp-admin when I do this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Please modify your plugin for wpdb prepare’ is closed to new replies.