Support » Fixing WordPress » Wpdb not return result, query is qorking, no error

  • I have a weird error using $wpdb, when I tight up my query, to filter the data more, wpdb simply return empty. All tables are inside WP’s database, and all have the sufficient rights to query them, since querying them one by one, its always working without any problem.

    But when I run a query, which isn’t complex, contains only seven inner joins, I simply got back an empty result.
    global $wpdb is defined, I use $wpdb->show_errors(); $wpdb->print_error(); also print_r($wpdb) not show any error. The environment is a multisite environment, so I even tried to use define( ‘DIEONDBERROR’, true );
    But still, $res = $wpdb->get_results($wpdb->prepare(“[query_strign]”, $parameter)); will return nothing. if I use wpdb->last_query, the query works perfectly. If I ease up a few join, to get wider result it will return the correct rows.

    So, simply: WHAT THE $$$$ IS THIS?????

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer



    No results matched your query. What is it you’re querying for?

    When I run the query outside the WP its working perfectly, I querying user defined tables, but according the codex it should work, and work as well if I not tighten up the query

    Okay, I think I solve the question, our admin configured something really differently, since with an another fresh installation its working.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wpdb not return result, query is qorking, no error’ is closed to new replies.