Support » Fixing WordPress » trying to query custom table

  • 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

  • The topic ‘trying to query custom table’ is closed to new replies.