我有wp_places自定义表,并且在打印数组时得到了这个:
[0] => stdClass Object
(
[home_location] => 24
)
[1] => stdClass Object
(
[home_location] => 29
)
现在我想以这种方式(24,29)内爆值,但在我的代码中我收到了这个错误:
<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
我的代码
$getGroupType = $_POST['parent_category'];
$result = $wpdb->get_results( "SELECT home_location FROM wp_places WHERE blood_group LIKE '".$getGroupType."%'" );
$bgroup = Array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$bgroup[] = implode(',',$row);
}
echo implode(',',$bgroup);
有什么想法或建议吗?谢谢。