Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/07/2009, 15:55
Avatar de jcxnet
jcxnet
 
Fecha de Ingreso: octubre-2005
Ubicación: Perú
Mensajes: 784
Antigüedad: 18 años, 7 meses
Puntos: 56
Respuesta: Como puedo mostrar lo ultimos registros??

Tendrías que hacer lo siguiente:
1- Obtener los últimos 4 temas:
Código PHP:
$query "SELECT id,forum_id,topic_title FROM usebb_topics ORDER BY id DESC LIMIT 0,4";
$temas mysql_query($query) or die(mysql_error()); 
2- Generar la lista de temas en base al formato html :
Código PHP:
$lista '';
while(
$r mysql_fetch_array($temas)) {
   
$title $r['topic_title'];
   
$id $r['id'];
   
$lista .= "
         <p><span class='sidelinks'>
        <strong>
       <a href='./community/topic.php?post=$id'>$title</a>
       </strong></span>
       <br/>
</p>"
;

3. Mostrar los temas:
Código PHP:
echo "
<td width='191' valign='top' background='./images/pixi_greyblue.gif' class='sidetable'> 
            <table width='100%' border='0' cellspacing='0' cellpadding='10'>
              <tr> 
                <td><h3 class='sidetable2'>Ultimos Temas</h3>
                  $lista
                 </td>
              </tr>
                <tr> 
                <td><h3 class='sidetable2'>Ultimo Miembro</h3>
                  <div class='sidelinks'>
                    <a href='./community/profile.php?id=$userid'>$username</a></span>
                  </td>
              </tr>
            </table></td> 
Prueba y luego nos comentas

__________________
►I'm a devil on the run ♂
Jcxnet.com
*Keep It Simple **