我想要一個按鈕,單擊該按鈕時,它會生成與上一個頁面相似的頁面(該按鈕所在的位置),并自動將用戶發(fā)送到打印選項頁面。此頁面包含來自sybase數(shù)據(jù)庫的數(shù)據(jù),我通過odbc獲取該數(shù)據(jù)。問題是,當(dāng)嘗試生成打印頁面時,由于“內(nèi)存不足問題”,我無法獲取頁面。錯誤:致命錯誤:第83行的C:\ xampp \ htdocs \ CodeIgniter \ Samsic \ application \ models \ Pagamentos_model.php中的內(nèi)存不足(已分配392167424)(試圖分配387973888字節(jié))是的,我在StackOverflow上看到了大多數(shù)有關(guān)“內(nèi)存不足(..)試圖分配(..)”的類似問題。這是不同的,因為在此類似問題的答案都無法解決!我試過了:ini_set('memory_limit', '-1');ini_set('memory_limit', '128M');這些都不起作用。我正在使用MVC,這是我正在使用的代碼:模型: <?php ini_set('memory_limit', '-1'); class Pagamentos_model extends CI_Model { public function imprimir($ano,$codigo){ require(APPPATH.'libraries/odbc_conn.php'); $query = odbc_exec($db, 'Select * from GP_Vw_Valores_Pagos where Ano='.$ano.' and Codigo='.$codigo.' order by CD'); $row=odbc_fetch_array($query); $output= '<h1 style="text-align: center;"> Pagamentos'.$ano.' </h1> <table class="table" style="width: 100%; margin-bottom:40px; margin-top: 15px; "> <thead> <tr style="font-size: 1em;margin-bottom: 15px;text-align: center;"> <th scope="col">CD</th> <th scope="col">Descri??o</th> <th scope="col">Tipo</th> <th scope="col">Janeiro</th> <th scope="col">Fevereiro</th> <th scope="col">Mar?o</th> <th scope="col">Abril</th> <th scope="col">Maio</th> <th scope="col">Junho</th> <th scope="col">Julho</th> <th scope="col">Agosto</th> <th scope="col">Setembro</th> <th scope="col">Outubro</th> <th scope="col">Novembro</th
1 回答

明月笑刀無情
TA貢獻(xiàn)1828條經(jīng)驗 獲得超4個贊
如果查詢和獲取成功,$row
則將不會false
并且while($row)
將無限循環(huán)。您要刪除此:
$row=odbc_fetch_array($query);
然后將其添加到您的循環(huán)中:
while($row=odbc_fetch_array($query)) {
- 1 回答
- 0 關(guān)注
- 159 瀏覽
添加回答
舉報
0/150
提交
取消