if ($paginas_totales > 0){
$ssql = "SELECT * FROM proyectos WHERE seccion = '".$seccion."' ORDER BY anyo desc LIMIT ".($pagina*6).", 6";
$rs = mysql_query($ssql);
if (mysql_num_rows($rs)) {
while ($row = mysql_fetch_array($rs)) {
$sql_foto_portada="SELECT * FROM imagenes where idproyecto='".$row["id"]."' and portada = true;";
$foto_portada = mysql_query($sql_foto_portada);
$row_portada = mysql_fetch_array($foto_portada);
$sql_fotos="SELECT * FROM imagenes where idproyecto='".$row["id"]."' and portada = false;";
$fotos = mysql_query($sql_fotos);
?>
if (mysql_num_rows($fotos)) {
while ($row_foto = mysql_fetch_array($fotos)) {
?>
}
}
?>
if ($row = mysql_fetch_array($rs)) {
$sql_foto_portada="SELECT * FROM imagenes where idproyecto='".$row["id"]."' and portada = true;";
$foto_portada = mysql_query($sql_foto_portada);
$row_portada = mysql_fetch_array($foto_portada);
$sql_fotos="SELECT * FROM imagenes where idproyecto='".$row["id"]."' and portada = false;";
$fotos = mysql_query($sql_fotos);
?>
if (mysql_num_rows($fotos)) {
while ($row_foto = mysql_fetch_array($fotos)) {
?>
}
}
?>
} ?>
}
}
}
?>
}else{ ?>
if ($paginas_totales > 0){
$ssql = "SELECT * FROM proyectos WHERE seccion = '".$seccion."' ORDER BY anyo desc LIMIT ".($pagina*17).", 17";
$rs = mysql_query($ssql);
if (mysql_num_rows($rs)) {
while ($row = mysql_fetch_array($rs)) {
if ($row["anyo"] != $anyo_anterior){ ?>
if( 17*($pagina + 1) > $proyectos_totales["count(id)"] ) {
$limite_pagina = $proyectos_totales["count(id)"];
}
else{
$limite_pagina = 17*($pagina + 1);
}
?>
Mostrando del
1 al de un total de
if ($pagina < $paginas_totales-1){
$pagina_siguiente = $pagina + 1;
?>
Next page →
} else { ?> }?>