要使Placehold工作,您应该使用$wpdb->查询,如:
$wpdb->query(
$wpdb->prepare( "
SELECT * FROM mailer
WHERE id = %d
",
$_GET[\'caId\']
)
);
然而,在我看来,最好的选择是简单地验证get参数,然后在$wpdb->get\\u结果中使用它,例如:
$catId = $_GET[\'caId\'];
if(is_numeric($catId)){
$_crds = $wpdb->get_results(" SELECT * FROM mailers WHERE id = $catId");
foreach ($_crds as $_crds) {
$_zipcodes = $_crds->zipcodes;
$_maildate = $_crds->maildate;
}
}