📜  php wpdb foreach - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:47.726000             🧑  作者: Mango

代码示例2
$records=$wpdb->query("SELECT * FROM $wpdb->posts WHERE post_type = 'elements' AND post_status = 'publish'");

    while($data=$records->fetch_assoc())
    {
        print_r($data);
    }
    
}