trying to query custom table (1 post)

  1. surreal53
    Posted 2 years ago #

    I am trying to query a custom table in my wordpress db. Currently my result is returning null. Does anyone have any ideas why?

    Here is my code:

    $query = "SELECT * FROM photos";
    global $wpdb;
    $result = $wpdb->get_results( $query , ARRAY_A );
    if(!$result) {
        die('invalid query');

    Thanks a lot

Topic Closed

This topic has been closed to new replies.

About this Topic