如何使用mysql获得超过50个结果以显示在excel中? [英] How can i get more then 50 results to display in excel using mysql?

查看:118
本文介绍了如何使用mysql获得超过50个结果以显示在excel中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索并搜索,我找不到我的答案。我希望有人可以帮忙我有一个代码可以搜索一个mysql数据库,并在网站上显示X个结果。我的搜索者可以将结果导出到Excel表格中。我的问题是结果在数百上回来,电子表格只会显示50。这个代码还有更多的东西,但是有些东西告诉我,也许它在这里,并且在我显示中保存超过400行代码这个。

  $ sql。=,
IF(cycle_id = 4,
4 $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $

IF(cycle_id = 3,
。((3 == $ next_available_quarter)?
'$ next_available_quarter_month [3]。 - {$ next_available_quarter_year}':
'。$ next_available_四分之一[3]。 - 。 ($ next_available_quarter_year + 1)。 )。

IF(cycle_id = 2,
。((2 == $ next_available_quarter)?
'$ next_available_quarter_month [2] - {$ next_available_quarter_year
$ b'$ $ $ $ $ $ $ $ $ $ $ $ $$($ = = $ next_available_quarter)?
'$ next_available_quarter_month [1]。 - {$ next_available_quarter_year}':
'$ next_available_quarter_month [1] - 。($ next_available_quarter_year +






)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
状态
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或tsr.active ='Y')
LIMIT 0, 50
;


解决方案

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


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

解决方案

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

这篇关于如何使用mysql获得超过50个结果以显示在excel中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆