WordPress.org

Support

Support » How-To and Troubleshooting » How to run own query with wp_query?

How to run own query with wp_query?

  • Hi

    I like to get a custom array from a db table to create a table in a page template

    like

    global  $wpdb;
    
      // find list of events
      $qry = "SELECT select event_name, event_link, event_loc, event_desc, event_start_time, event_end_time FROM wp_wplistcal ORDER BY event_start_time ASC";
      $events = $wpdb->get_results( $qry );
    var_dump($events);

    but it just returns array(0) { }

    I know for a fact that the table has values.

    So how can i use own queries in WP??

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to run own query with wp_query?’ is closed to new replies.