WordPress.org

Ready to get started?Download WordPress

Forums

trying to query custom table (1 post)

  1. surreal53
    Member
    Posted 1 year 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 );
    $wpdb->show_errors();
    if(!$result) {
        die('invalid query');
    }

    Thanks a lot

Topic Closed

This topic has been closed to new replies.

About this Topic