Tema: Columnas
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/11/2008, 16:39
Chemix
 
Fecha de Ingreso: mayo-2003
Mensajes: 92
Antigüedad: 20 años, 11 meses
Puntos: 0
Respuesta: Columnas

Resuelto!

Código PHP:
 <?php 

if($location_sort
{
    
$sort1 "ORDER BY countryname";
}
else
{
    
$sort1 "ORDER BY c.pos";
}      

$sql "SELECT * FROM $t_countries c INNER JOIN $t_cities ct ON c.countryid = ct.countryid AND ct.enabled = '1' WHERE c.enabled = '1' GROUP BY c.countryid $sort1";
$resc mysql_query($sql);

$tr=1;
$columnas =2;

while(
$country mysql_fetch_array($resc))
{

    if(
$tr/($columnas+1)==1){echo "</tr><tr>";
            
$tr=1;
        }
    
    if(
$sef_urls$country_url "{$vbasedir}-$country[countryid]/" RemoveBadURLChars($country['countryname']) . "/";
    else 
$country_url "?cityid=-$country[countryid]&amp;lang=$xlang";
    
    
?>
        <td> 
        <img style="vertical-align: middle" src="images/bullet.gif" alt="" border="0"> 
        <a href="$country_url"><?php echo $country['countryname']; ?></a> 
        </td>
        <?php
$tr
++;
if(
$tr/($columnas+2)==1){echo "</tr>";}
}
 while (
$tr <= $columnas):
     echo 
"<td>&nbsp;</td>";
     
$tr++;
 endwhile;
mysql_free_result($r);
?>
Saludos