您好,我一直在用PHP开发,现在才开始向Wordpress过渡。在PHP中,我有这个->
// Prepare statement
$sqlstatement = $conn->prepare("INSERT INTO importtest (id, area, country, city, town, postcode,
lotarea, price, bedrooms, bathrooms, summary, latitude, longlitude, street, streetno, type, image)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
// Bind the parameters I want (datatype, parameters)
$sqlstatement->bind_param(\'sssssssssssssssss\', $ID, $area, $country, $city, $town, $postcode, $lotarea, $price,
$bedrooms, $bathrooms, $summary, $latitude, $longlitude, $street,
$streetno, $name, $image);
// Execute
$sqlstatement->execute();
我注意到,wpdb的insert采用列名、数据和数据类型中的数组。我的问题是Wordpress是否有一个绑定参数的等价物,因为我确信不能只插入变量?