0

I've searched and searched and i can't find my answer. i'm hoping someone can help. I have a code that searches a mysql database and displays X amount of results on a website. I searcher can then export the results into an excel spreadsheet. my problem is the results come back in the hundreds and the spreadsheet will only show me 50. there is a lot more to this code but something is telling me perhaps it's in here and to save putting over 400 lines of code in i'm showing this.

$sql .= ",
                        IF (cycle_id = 4,
                            " . ((4 == $next_available_quarter) ?
                                "'" . $next_available_quarter_month[4] . "-{$next_available_quarter_year}'" :
                                "'" . $next_available_quarter_month[4] . "-" . ($next_available_quarter_year+1) . "'") . "
                            ,
                            IF (cycle_id = 3,
                                " . ((3 == $next_available_quarter) ?
                                    "'" . $next_available_quarter_month[3] . "-{$next_available_quarter_year}'" :
                                    "'" . $next_available_quarter_month[3] . "-" . ($next_available_quarter_year+1) . "'") . "
                                ,
                                IF (cycle_id = 2,
                                    " . ((2 == $next_available_quarter) ?
                                        "'" . $next_available_quarter_month[2] . "-{$next_available_quarter_year}'" :
                                        "'" . $next_available_quarter_month[2] . "-" . ($next_available_quarter_year+1) . "'") . "
                                    ,
                                    " . ((1 == $next_available_quarter) ?
                                        "'" . $next_available_quarter_month[1] . "-{$next_available_quarter_year}'" :
                                        "'" . $next_available_quarter_month[1] . "-" . ($next_available_quarter_year+1) . "'") . "
                                    )
                                )
                            )
                        )
                    )
                )
            ) as next_run
    FROM
        tax_search_loans tsl
    LEFT JOIN
        tax_searches ts
    ON
        (tsl.tax_search_loan_id = ts.tax_search_loan_id)
    LEFT JOIN
        tax_search_results tsr
    ON
        (tsr.tax_search_id = ts.tax_search_id)
    LEFT JOIN
        states
    ON
        (tsl.state_id = states.state_id)
    LEFT JOIN
        tax_search_loan_officers tslo
    ON
        (tslo.tax_search_loan_officer_id = tsl.tax_search_loan_officer_id)
    WHERE
        tsl.active = 'Y' AND
        tslo.active = 'Y' AND
        tslo.customer_code IN ('" . implode("','", explode(',', $DB->cleanString($_GET['custcodes']))) . "') AND
        (ts.active IS NULL OR ts.active = 'Y') AND
        (tsr.active IS NULL OR tsr.active = 'Y')
        LIMIT 0, 50
    ";

1 Answers1

2

Remove the LIMIT 0, 50 statement or change it to whatever you want your max rows displayed to be.

Bosak
  • 2,103
  • 4
  • 24
  • 43
  • I tried that but if say I need 1000 or more to display it times out and I get an error. I've tried looking for my /etc/my.cnf using putty but there isn't anything useful in there maybe only 10 lines of code nothing pertaining to a row limit or count. – Crystal Leahy Jul 24 '12 at 20:41
  • pretty large and there are customers that have only a couple hundred entries and other that have 1500 and i need to have the results for any given customer displayed in the excel spreadsheet. I'm thinking i need to add code to /etc/my.cnf for a row limit but i'm not sure how to write it i'm looking that up as well. – Crystal Leahy Jul 25 '12 at 12:38
  • does changing it to `LIMIT 1500` help? – Bosak Jul 25 '12 at 16:17
  • no i get a webpage can not be displayed. but if i select a certain customer and put the exact number they have in their results into the code the excel spreadsheet will display the correct amount of rows. problem is i can't do that every time a customer logs in to see their results. – Crystal Leahy Jul 25 '12 at 18:18
  • could it be that my /etc/my.cnf is running the default? i'm not very familiar with mysql i'm learning and not really sure what my.cnf is supposed to look like the one i have only has 9 lines of code. – Crystal Leahy Jul 25 '12 at 18:26