PARA USAR DOS COLORES (Esta con paginator incluido):
Código PHP:
include("conexion.php");
$con = mysql_connect("$host","$user","$pass") or die (mysql_error());
mysql_select_db("$db",$con) or die (mysql_error());
//Sentencia sql (sin limit)
$_pagi_sql = "SELECT * FROM vidarutinaria ORDER BY id DESC";
//cantidad de resultados por página (opcional, por defecto 20)
$_pagi_cuantos = 15;
$_pagi_nav_num_enlaces = 5;
//Incluimos el script de paginación. Éste ya ejecuta la consulta automáticamente
include("paginator.php");
$lista_colores=array('VR_tabla0','VR_tabla1');
$num_colores=2;
$indice=0;
while($row = mysql_fetch_array($_pagi_result))
{
$color=$lista_colores[$indice % $num_colores];
$indice++;
echo '<TABLE cellpadding="2" cellspacing="0" "border=0 width="100%" class="'.$color.'"><tr><td class="VR_textos" title="'.$row["fecha"].'"><img src=fotos_vidarutinaria/'.$row["foto"].'"><br><b>'.$row["comentario"].':</b></td></tr></table>';
};
//Incluimos la barra de navegación
echo '<br><table width=100% height="18" border=1 align="center" cellpadding=0 cellspacing=0 bordercolor="#000000" class="VR_tabla1">
<tr>
<td width="100%" height="1" align=center bordercolor="#99c0e6"><font face="Geneva, Arial, Helvetica, sans-serif" size="2">'.$_pagi_navegacion.'</font></td>
</tr>
</table><br>';
Código PHP:
include("conexion.php");
$result=mysql_db_query($db,"select * from vidarutinaria ORDER BY id DESC") or die (mysql_error());
$cols = 2;
$num=mysql_num_rows($result);
$filas = $num / $cols;
echo "<table>";
for ($i = 0; $i < $filas; $i++)
{
echo "<tr>";
for ($j=0; $j < $cols ; $j++)
{
$row=mysql_fetch_array($result);
if ($row["foto"] == "")
{
echo '<td></td>';
}
else
{
echo '<td><img src="fotos_vidarutinaria/'.$row["foto"].'"><br><b>'.$row["comentario"].'</b></td>';
}
}
echo "</tr>";
}
echo "</table>";
mysql_free_result($result);