(PHP) ошибка при выводе большого массива данных

Владимир777111

Новичок
урезанный header.htm , при нем где выборка до 10 строк с рабочей станции и до 200 с сервера

<?

if ('/header.htm' == $PHP_SELF)
header('Location: /');


function k_reg ($string)
{
$string = str_replace("А","а",$string);
$string = str_replace("Б","б",$string);
$string = str_replace("В","в",$string);
$string = str_replace("Г","г",$string);
$string = str_replace("Д","д",$string);
$string = str_replace("Е","е",$string);
$string = str_replace("Ё","ё",$string);
$string = str_replace("Ж","ж",$string);
$string = str_replace("З","з",$string);
$string = str_replace("И","и",$string);
$string = str_replace("Й","й",$string);
$string = str_replace("К","к",$string);
$string = str_replace("Л","л",$string);
$string = str_replace("М","м",$string);
$string = str_replace("Н","н",$string);
$string = str_replace("О","о",$string);
$string = str_replace("П","п",$string);
$string = str_replace("Р","р",$string);
$string = str_replace("С","с",$string);
$string = str_replace("Т","т",$string);
$string = str_replace("У","у",$string);
$string = str_replace("Ф","ф",$string);
$string = str_replace("Х","х",$string);
$string = str_replace("Ц","ц",$string);
$string = str_replace("Ч","ч",$string);
$string = str_replace("Щ","щ",$string);
$string = str_replace("Ш","ш",$string);
$string = str_replace("Э","э",$string);
$string = str_replace("Ы","ы",$string);
$string = str_replace("Ь","ь",$string);
$string = str_replace("Ъ","ъ",$string);
$string = str_replace("Ю","ю",$string);
$string = str_replace("Я","я",$string);
return $string;
}

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Справочная Дельф</title>
<link href="/style.css" rel="stylesheet" type="text/css" />

<table cellpadding="0" cellspacing="0" class="t2">
<tr>
<td align="left" width="99%">
<div class="div3">

<form action="/search/" method="post">
<select name="rub">
<?
$id_category = $_POST['rub'];
if ($id_category>1)
{?><option selected value="1">Все разделы</option>
<option selected value='<?echo $id_category;?>'><?

$request = "SELECT id,title
FROM delf_category WHERE id=$id_category ";
$result = mysql_query($request);

while($row = mysql_fetch_array($result))
{
$tt = $row[title];
}
echo k_reg($tt);?></option>



<?}
else
{?><option selected value="1">Все разделы</option><?}

$q = "select id, title from delf_category";
$result = mysql_query($q) or
die("There was a MySQL error".mysql_error());
while(list($id, $title) = mysql_fetch_row($result)) {
echo "<option value=$id>".k_reg($title)."</option>";
}
?>

</select><class="div4">
<input type="checkbox" name="C1" value="ON"> <a class="sx8" style="font-size: 11px; font-weight: bold">по фирмам<br>

<input name="action" type="hidden" value="search">
<input name="text_search" value='<?echo $text_search1;?>' style="font-size: 9px" type="text" size="29">
<input alt="Найти" height="17" src="/i/search.gif" style="background-color: white" title="Найти" type="image" width="18">
</a><a class="sx8" style="font-size: 11px; font-weight: bold">&nbsp; &nbsp;от:&nbsp;<input name="ot" value='<?echo $ot;?>' style="font-size: 9px" size="4"></a>&nbsp;&nbsp;<a class="sx8" style="font-size: 11px; font-weight: bold">до:&nbsp;<input name="do" value='<?echo $do;?>' style="font-size: 9px" size="4">&nbsp;&nbsp;руб.</a>


</form>
</div>

<div style="padding: 15px 300px 0px 80px">

<nobr><a class="sx1" href="/cabinet/" style="font-size: 11px; font-weight: bold">Личный кабинет</a></nobr><br>
<nobr><a class="sx1" href="/order/" style="font-size: 11px; font-weight: bold">Заявка</a></nobr>
</div>
</td>
<td width="10%"></td>
</tr>
</table>

</head>
<body>
 

Владимир777111

Новичок
function k_reg ($string)
...
убрал

теперь выборка доходит до 100 строк с рабочей станции (раньше до 10 строчки)
уменьшаю скрипт, увеличивается выводимая выборка

у меня, что срабатывает ограничение по памяти? Хотя вроде не так много-то надо...
 

HEm

Сетевой бобер
Как ты определяешь, что доходит до N-ой строчки? содержимое страницы до нее показывается а потом обрезается?
 

Владимир777111

Новичок
да, может обрезаться и на половине строчки и выскакивает ошибка IE выдает где то после 100 выведенной строчки "ошибка загрузки указанного ресурса" или "ошибка в расширениях интернета" как и раньше

-~{}~ 07.04.06 13:17:

текущие настройки в php.ini , может что поменять?

max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Default timeout for socket based streams (seconds)
default_socket_timeout = 60
; Maximum time (in secondes) for connect timeout. -1 means no limit
mysql.connect_timeout = 60
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0
session.gc_maxlifetime = 1440
; Connect timeout
;mssql.connect_timeout = 5
; Query timeout
mssql.timeout = 60
; Default timeout in seconds.
pfpro.defaulttimeout = 30
 

HEm

Сетевой бобер
Хз, надо обрезать скрипт до рабочего состояния и по чуть-чуть прибавлять функциональность.
Также включить вывод всех ошибок и таки еще раз посмотреть логи.
Я так понимаю на рабочей станции тоже наблюдается глюк? на http://localhost
 

Владимир777111

Новичок
ведь конструкция


PHP:
--------------------------------------------------------------------------------

$bufOut = "";
while (($row = mysql_fetch_array($result)))
{
$bufOut .= $row['title'].' '.$row['cdata'].' '.$row['packaging'].' '.$row['producer'].' '.$row['type'].' '.$row['price_opt'].' '.$row['price_roz']."\n";
}
echo $bufOut;

--------------------------------------------------------------------------------



работает до 1000 строк!

но мне надо чтобы справа каждой строчки были чекбоксы, а как это сделать в этой конструкции я не знаю


PHP:
--------------------------------------------------------------------------------

while(list($ptitle,$cdata,$packaging,$producer,$ty
pe,$price_opt,$price_roz,$id,$ctitle,$phone,$id_pr
ice) = mysql_fetch_row($result))
{
echo '<tr style="">
<td>'.$ptitle.'&nbsp;</td>
<td>'.$cdata.'&nbsp;</td>
<td>'.$packaging.'&nbsp;</td>
<td>'.$producer.'&nbsp;</td>
<td>'.$type.'&nbsp;</td>
<td>'.$price_opt.'&nbsp;</td>
<td>'.$price_roz.'&nbsp;</td>
<td><a href="/company/?id='.$id.'" target="_blank" class="sx5">'.$ctitle.'</a></td><td>'.$phone.'</td>';
echo '<td>'?><form action="/search/psearch.php" method="POST">
<input type="checkbox" name="nameId[]" value="<?echo $id_price;?>" checked>
<?'</td></tr>';
}
echo '</table>';
 

HEm

Сетевой бобер
а зачем для каждого чекбокса отдельная форма?
<input type="checkbox" name="<?echo $id_price;?>
 

Владимир777111

Новичок
переделал все чек боксы сверу строк , а надо, чтобы правее каждой строчки

?><form action="/search/psearch.php" method="POST"><?
$bufOut = "";
while(list($ptitle,$cdata,$packaging,$producer,$type,$price_opt,$price_roz,$id,$ctitle,$phone,$id_price) = mysql_fetch_row($result))
{
$bufOut .= '<tr style="">
<td>'.$ptitle.'&nbsp;</td>
<td>'.$cdata.'&nbsp;</td>
<td>'.$packaging.'&nbsp;</td>
<td>'.$producer.'&nbsp;</td>
<td>'.$type.'&nbsp;</td>
<td>'.$price_opt.'&nbsp;</td>
<td>'.$price_roz.'&nbsp;</td>
<td><a href="/company/?id='.$id.'" target="_blank" class="sx5">'.$ctitle.'</a></td><td>'.$phone.'</td>
<td>'?> <input type="checkbox" name="nameId[]" value="<?echo $id_price;?>" checked>
<?'</td></tr>';
}
echo $bufOut;
echo '</table>';

?><div align="right"><p><p align="right"><input type=submit name=submit value="выбрать"></p></div>

</form><?
 

HEm

Сетевой бобер
используй текстовый редактор с подсветкой, в твоем коде куча ошибок
и указанное изменение в чекбоксе ты не сделал
 

Владимир777111

Новичок
скрипт

PHP:
--------------------------------------------------------------------------------

$bufOut = "";
while ($row = mysql_fetch_array($result))
{
$bufOut .= $row['title'].' '.$row['cdata'].' '.$row['packaging'].' '.$row['producer'].' '.$row['type'].' '.$row['price_opt'].' '.$row['price_roz'].' ';
}
echo $bufOut;

--------------------------------------------------------------------------------


выводит более 1000 строк, но мне нужен вывод в табличном виде и с чекбоксами
в этом же скрипте добавляю

PHP:
--------------------------------------------------------------------------------

?>

<table width="100%" style="margin-left: 2px" margin-right: 2px; margin-bottom: 2px border="1" cellpadding="3" cellspacing="0" class="sx6_big"><tr style="font-weight: bold;">
<td width="30%" >Наименование</td>
<td width="17%">Дополнительно</td>
<td >Фасовка</td>
<td >Производ.</td>
<td >Ед.изм.</td>
<td >Опт.цена</td>
<td >Роз.цена</td>
<td width="15%" >Фирма</td>
<td width="18%" >Телефон</td>
<td>Выбор</td>
</tr>
<?


?><form action="/search/psearch.php" method="POST"><?
$bufOut = "";
while ($row = mysql_fetch_array($result))
{
$bufOut .= '<tr style="">
<td>'.$row[ptitle].'&nbsp;</td>
<td>'.$row[cdata].'&nbsp;</td>
<td>'.$row[packaging].'&nbsp;</td>
<td>'.$row[producer].'&nbsp;</td>
<td>'.$row[type].'&nbsp;</td>
<td>'.$row[price_opt].'&nbsp;</td>
<td>'.$row[price_roz].'&nbsp;</td>
<td><a href="/company/?id='.$row[id].'" target="_blank" class="sx5">'.$row[ctitle].'</a></td><td>'.$row[phone].'</td>
<td><input type="checkbox" name="nameId[]" value='.$row[id_price].' checked>
</td></tr>';
}
echo $bufOut;
echo '</table>';

?><div align="right"><br><p align="right"><input type=submit name=submit value="Выбрать"></p></div>

</form><?


--------------------------------------------------------------------------------


и IE затыкается на 200 строчке, может быть дело тэгах таблицы?
 

HEm

Сетевой бобер
Может, имеет смысл разделить вывод на кусочки хотя бы по 100, а лучше по 30 строчек?
 
Сверху