2013-01-16 100 views
-3

我在wordpress中安裝了html5視頻播放器插件,它顯示以下錯誤。請讓我知道我該如何解決它。缺少wpdb :: prepare()的參數2錯誤

Warning: Missing argument 2 for wpdb::prepare(), called in C:\xampp\htdocs 
\wordpress\wp-content\plugins\lbg-vp2-html5-bottom\lbg-vp2-html5-bottom.php on 
line 373 and defined in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 990 

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\wordpress 
\wp-content\plugins\lbg-vp2-html5-bottom\tpl\players.php on line 41 
+0

這將有助於爲兩個消息編碼上下文。 –

+0

[作者](http://codecanyon.net/item/html5-video-player-wordpress-plugin/discussion/1613464?page=3)能否提供一些反饋?您是否[排除故障](http://wordpress.org/support/topic/troubleshooting-wordpress-35-master-list)您的安裝?其他[調試](http://codex.wordpress.org/Debugging_in_WordPress)信息? – brasofilo

回答

1

$wpdb->prepare作品像sprintfvsprintf。它應該有一個字符串,後跟可變數量的參數。

$wpdb->prepare(
    "SELECT * FROM {$wpdb->posts} WHERE post_title = %s", 
    'My Great Title' 
); 

它曾經只是傳遞的數據通過,如果第二個參數是失蹤,所以你可以做這樣的事情:

$wpdb->prepare(
    "SELECT * FROM {$wpdb->posts} WHERE post_title = 'My Great Title'" 
); 

它違背了prepare點,但它的工作和人民做了它 - 也許只是出於習慣,也許出於誤解prepare的作用。 Recent changes have altered that behavior and it now fails with an error

無可否認,我在猜測,但我認爲那是你所看到的問題。