|
|
|
| как сформировать ссылку в зав. от рез-та запроса?
for ($i=1; $i <=$num_row; $i++)
{
$row=mysql_fetch_assoc($index);
echo $row['index'];// запрос возвращает в цикле следующие значения 0, 2, 3, 16. кол-во заранее неизвестно
$$i="index";
$index="${$i}$i";
}
//header ("location:index.php?xxxxxx");// здесь должны получить index.php?index1=0&index2=2&index3=3&index4=16
|
| |
|
|
|
|
|
|
|
для: ok computer
(24.01.2008 в 10:46)
| |
<?php
// ;
for ($i=1; $i <=$num_row; $i++) {
$row = mysql_fetch_assoc($index);
//echo $row['index'];
//$var[$i][] = 'index'.$i;
//$value[$i][] = $row['index'];
$str .= 'index'.$i.'='.$row['index'].'&';
}
// ;
header ('location:index.php?'.$str);
?>
|
| |
|
|
|
|
|
|
|
для: Петр
(24.01.2008 в 11:17)
| | спасибо. чтобы не создавть новую тему.
как записать первые 5 значений $row['index'] в переменную $str1=x,x,x,x,x | |
|
|
|
|
|
|
|
для: ok computer
(24.01.2008 в 12:08)
| |
<?php
//in cycle
if($i<5)
{$temp_arr[] = $row['index'];}
//end of cycle
$str1 = implode(',',$temp_arr);
?>
|
| |
|
|
|