Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/12/2009, 20:07
rastafinis
 
Fecha de Ingreso: mayo-2006
Mensajes: 86
Antigüedad: 18 años
Puntos: 0
ayuda con paginacion de consulta mysql

manes aqui yo otra vez con mis problemas T_T

tengo este table que es para un pequeño foro que estoy creando

lo que deseo es poder paginar los datos que me salen de esta consulta

pero el detalle es que no se como U_U

alguan idea o sugerencia porfavor gracias

Código:
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="25"><div id="moduloforos"><? echo $lang['titulomoduloforo'] ?></div></td>
                  </tr>
<?
$connection = mysql_connect ($lang['bd_host'],$lang['bd_usuario'],$lang['bd_password']);
if(!$connection) { die(mysql_error()); }
mysql_select_db($lang['bd_base']);
if(!@mysql_select_db($lang['bd_base'],$connection)) { die(mysql_error()); }
if ($cat == 0){$sql_text = "SELECT * FROM johwic_topicos WHERE foro_id <> '$cat' order by grupo_id desc "; }
else {$sql_text = "SELECT * FROM johwic_topicos WHERE foro_id = '$cat' order by grupo_id desc "; }
if ($r = mysql_query($sql_text,$connection)){
while ($row = mysql_fetch_array($r)){
	

                 $cats++; 

$resto = substr ($row['topico_titulo'], 0, 48 );

?>
                  <tr>
                    <td width="" align="left" valign="top" id="resultadosdb" onClick="MM_goToURL('parent','ficha.php?ndii=<? echo $row['topico_id'] ?>');return document.MM_returnValue"><div id="moduloforos2">
					
							<? $idforo = $row['foro_id']; 
							if($idforo == 1) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/flash.gif" width="20" height="20"><? } 
							if($idforo == 2) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/temas.gif" width="20" height="20"><? }
							if($idforo == 3) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/arte.gif" width="20" height="20"><? }
							if($idforo == 4) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/autos.gif" width="20" height="20"><? }
							if($idforo == 5) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/cel.png" width="20" height="20"><? }
							if($idforo == 6) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/Comic.gif" width="20" height="20"><? }
							if($idforo == 7) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/deportes.png" width="20" height="20"><? }
							if($idforo == 8) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/descargas.gif" width="20" height="20"><? }
							if($idforo == 9) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/tutoriales.gif" width="20" height="20"><? }
							if($idforo == 10) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/economia.gif" width="20" height="20"><? }
							if($idforo == 11) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/mujeres.png" width="20" height="20"><? }
							if($idforo == 12) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/humor.gif" width="20" height="20"><? }
							if($idforo == 13) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/imagenes.gif" width="20" height="20"><? }
							if($idforo == 14) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/informacion.png" width="20" height="20"><? }
							if($idforo == 15) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/juegos.png" width="20" height="20"><? }
							if($idforo == 16) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/link.gif" width="20" height="20"><? }
							if($idforo == 17) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/linux.gif" width="20" height="20"><? }
							if($idforo == 18) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/mac.gif" width="20" height="20"><? }
							if($idforo == 19) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/manga.png" width="20" height="20"><? }
							if($idforo == 20) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/mascota.gif" width="20" height="20"><? }
							if($idforo == 21) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/musica.jpg" width="20" height="20"><? }
							if($idforo == 22) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/noticias.png" width="20" height="20"><? }
							if($idforo == 23) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/offtopic.gif" width="20" height="20"><? }
							if($idforo == 24) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/patrocinados.jpg" width="20" height="20"><? }
							if($idforo == 25) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/recetas.gif" width="20" height="20"><? }
							if($idforo == 26) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/salud.png" width="20" height="20"><? }
							if($idforo == 27) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/sociales.png" width="20" height="20"><? }
							if($idforo == 28) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/j.png" width="20" height="20"><? }
							if($idforo == 29) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/turismo.gif" width="20" height="20"><? }
							if($idforo == 30) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/peliculas.gif" width="20" height="20"><? }
                            if($idforo == 31) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/video.png" width="20" height="20"><? }
							?>                      
							
							<? $idgrupo = $row['grupo_id']; 
							if($idgrupo == 0) { ?><? } 
							if($idgrupo == 1) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/registrate.png" width="20" height="20"><? }
							if($idgrupo == 2) { ?><img src="http://www.forosdelweb.com/f18/imagenes/icopost/j.png" width="20" height="20"><? }
							?> 
							
				<span id="forspan"><? echo $resto; ?>...</span></div></td>
                  </tr>
<?
                 }}
mysql_close($connection);

              if($cats== 0) {

                  $cats= 0; }
?>
                </table>