$wpdb->get_results(…) returns empty array despite correct query


As title implies, I cannot seem to get $wpdb->get_results to give results. Running the “raw” query is successful, but this seems to be failing for some strange unknown reason.

    global $wpdb;

    $sql = "SELECT *
            FROM something aki, 
                 somethingelse akb, 
                 somethingelseelse ac 
            WHERE aki.keyID = akb.keyID 
              AND akb.someID = ac.someID 
              AND aki.type LIKE '%thing%'";

    $corps = $wpdb->get_results($sql, OBJECT);

1Up 2 months 0 Answers 10 views 0

Leave an answer