|
| |
|
|
| |
для: NIK
(15.10.2006 в 21:43)
| | | Если быть точным, в 4 столбца!
А подробнее! Чего то у меня не выводит! | |
| |
|
|
| |
|
|
| |
для: Diablo_
(15.10.2006 в 21:23)
| | | собственно я особо не понимаю зачем нужно делать ещё 2 вложенных цикла
for ($data1=array(); $row1=mysql_fetch_assoc($GLOBALS['my']->sql_res); $data1[]=$row1);
foreach ($data1 as $element1)
{
...
|
я так понимаю нужно вывести все строки в таблицу по три столбца?
$td_index = 0;
while ($club = mysql_fetch_array($GLOBALS['my']->sql_res) {
if ($td_index == 0) echo "<tr>";
# выводишь то что нужно
$i++;
if ($td_index == 3) {
echo "</tr>";
$td_index = 0;
}
}
|
| |
| |
|
|
| |
|
|
| | Помогите упростить код, а то у меня не получается, не хочу делать лишние!
include "config.php";
$t='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="4" class=style5 height="19" valign="middle" background="'.$prof_back.'"> '.$im_arry.' Список клубов</td></tr>';
$i=0;
$GLOBALS['my']->sql_query="select * from club_info WHERE liga='p' ORDER BY full_club_name";
$GLOBALS['my']->sql_execute();
if (@mysql_num_rows($GLOBALS['my']->sql_res)!=0)
{
for ($data1=array(); $row1=mysql_fetch_assoc($GLOBALS['my']->sql_res); $data1[]=$row1);
foreach ($data1 as $element1)
{
$i++;
if (($i%3)==0) $t.="<tr>";
$t.='<td width="45" id=info_club><img src="club/logo/small_'.$element1['id_club'].'.gif"></td><td width="800" id=info_club><a href="index.php?id=club&view='.$element1['id_club'].'"><b>'.strtoupper($element1['full_club_name']).'</b></a></td>';
if ((($i+1)%3)==0) $t.="</tr>";
$club_section=$element1['id_club'];
}
$t.="</table>";
echo "$t";
}
|
| |
| |
|
|
|