0

我已经搜索和搜索,但我找不到我的答案。我希望有人能帮忙。我有一个搜索 mysql 数据库并在网站上显示 X 数量的结果的代码。然后,我的搜索者可以将结果导出到 Excel 电子表格中。我的问题是结果以数百个形式返回,而电子表格只会显示 50 个。这段代码还有很多内容,但有些东西告诉我,它可能就在这里,为了节省在我展示的 400 多行代码中这个。

$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
    ";
4

1 回答 1

2

删除该LIMIT 0, 50语句或将其更改为您希望显示的最大行数。

于 2012-07-24T16:13:19.407 回答