How to select data from database in wordpress

Here is the code

private static function get_blog_ids() {

 global $wpdb;

 // get an array of blog ids
 $sql = "SELECT blog_id FROM $wpdb->blogs
  WHERE archived = '0' AND spam = '0'
  AND deleted = '0'";

 return $wpdb->get_col( $sql );


Related Post

Latest Post

Recent Posts Widget

Make sure to never miss a thing...

Get the latest news from the creative industry along with other creative goodies, conveniently delivered to social media.