請幫我解決這個問題。缺少wpdb的參數2 prepare()
我得到這個錯誤:
Missing argument 2 for wpdb::prepare()
對於此行:
$myrows = $wpdb->get_results($wpdb->prepare("SELECT name, term_id
FROM wp_categoryindex
WHERE alpha IN ('0','1','2','3','4','5','6','7','8','9')"));
謝謝!
的可能重複[?如何防止SQL注入的PHP(http://stackoverflow.com/questions/60174/how-可以防止SQL注入在php) –
看看這些:http://codex.wordpress.org/Class_Reference/wpdb#Protect_Queries_Against_SQL_Injection_Attacks和http://codex.wordpress.org/Data_Validation#Database –