• Hi, I have a problem with
    $wpdb->get_results
    when I send a query to return 2000 items.

    When I run the page I get a white screen and any messages or errors

    I think maybe this can be a wordpress’ bug,please help me, I need to fix this problem ASAP

    Thanks for the help

Viewing 5 replies - 1 through 5 (of 5 total)
  • Impossible to help you without more background of the problem, and specific details of what you have tried etc.

    Thread Starter usarioma

    (@usarioma)

    ok, I have this sentence in my template:
    $wpdb->get_results(“SELECT * FROM h_hotels WHERE CountryFileName=’italy’ GROUP BY CityName “);
    this query return 2000 rows, so the wordpress template crashed and I get a white screen

    but if the query only return a few rows dont have any problem

    please I need help

    I think you should consider to use LIMIT and pagination.
    And white screen may occur because of low memory available to WP.
    You may try to add to your wp-config.php something like:

    define('WP_MEMORY_LIMIT', '128M');

    Thread Starter usarioma

    (@usarioma)

    I need to show all the rows in the page, I will try adding
    define(‘WP_MEMORY_LIMIT’, ‘128M’);
    to my wp-config.php

    How many column fields are in the h_hotels table? Do you need to return every column? Your current query is returning every single column (SELECT * FROM h_hotels) so that combined with 2000 rows is causing you problems.

    For the initial list of returned queries could you not just return (and display) the bare minimum information then show all the columns you need if someone clicks on a hotel for more information (i.e. do you need all hotel column information on the whole list of 2000 hotels).

    Does that make sense?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Problem with $wpdb->get_results’ is closed to new replies.