Support » Plugin: Kw Modern Advertise » Warning: Missing argument 2 for wpdb::prepare(), called in…

  • Hello. I can not use the plugin. Just go to the settings I get this result:

    Warning: Missing argument 2 for wpdb::prepare(), called in D:\Inetpub\webs\..\wp-content\plugins\kw-modern-advertise\kw-modern-advertise.php on line 631 and defined in D:\Inetpub\webs\..\wp-includes\wp-db.php on line 992

    Look at the picture to understand better:
    http://i.imgur.com/9HgOlnA.png

    It is as if the plugin was loaded in half….
    I need to change something in kw-modern-advertise.php file? (line 631)

    $sql = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."background_partner WHERE Category LIKE '".$type."'");

    Thankz!

    http://wordpress.org/plugins/kw-modern-advertise/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The wpdb::prepare() method is used substitute values into a SQL statements safely. The first argument is the format of the SQL statement, with placeholders for the values, & the second is an array of values to use. If these aren’t present I’m not sur why you’d be using the prepare() method at all.

    Without seeing the plugin code it’s difficult to advise how to fix, but if it’s not going to actually escape any values, you could remove the prepare call…

    $sql = "SELECT * FROM ".$wpdb->prefix."background_partner WHERE Category LIKE '".$type."'";

    Thread Starter johndoeinsicuri

    (@johndoeinsicuri)

    Hello Toby. Thank you for responding.

    This is the php file of the plugin: kw-modern-advertise.php

    http://pastebin.com/MKWtKfg2

    Thread Starter johndoeinsicuri

    (@johndoeinsicuri)

    Update. Replacing the string with that of your files, hiding the error but I do know that the plugin shows a second part and needs to work lol.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warning: Missing argument 2 for wpdb::prepare(), called in…’ is closed to new replies.