Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/10/2008, 12:42
jeankex
 
Fecha de Ingreso: agosto-2008
Mensajes: 102
Antigüedad: 15 años, 8 meses
Puntos: 0
Respuesta: Mostrar datos de la base de datos

un entonces como hago por que eso es el mismo codigo que uso elq ue posteo pato 12 pero a mi no me sale:
http://www.buscaxtremo.com/nuevo/noticias.php
pos se supone que la noticia de naruto me debe aparecer primero pero aparece al ultimo?
cambie la linea como me dijiste:

esto es el cambio asi quedo:

Código PHP:
<?php
// verificamos si se ha enviado
// alguna variable via GET
if(isset($_GET['id']) && $_GET['categoria']){
    
// asignamos los valores
    // a las variables que usaremos
    
$cat_ID $_GET['id'];
    
$categoria $_GET['categoria'];
    
$clausula "WHERE notCategoriaID = '$cat_ID' ORDER BY 'not_ID' DESC";
    
// tambien armamos el titular de la pagina
    
$titulo "Noticias en la categoria: $categoria";
}else{
    
// de lo contrario
    // el titulo sera general
    
$titulo "Todas las noticias";
}
// armamos la consulta
$sqlQueryNot mysql_query("SELECT notTitulo, notFoto, notTexto FROM sn_noticias
                            $clausula"
$db_link)
                            or die(
mysql_error);
echo 
"<h1>$titulo</h1>";
// mostramos las noticias,
// otra vez usanod un bucle while
while($rowNot mysql_fetch_array($sqlQueryNot)){
    echo 
"<h1>$rowNot[notTitulo]</h1>";
    echo 
"<table cellspacing='0' cellpadding='0' width='448' 
            background='anuncios/bg_anuncio.jpg' 
            border='0' >
  <tr>
    <td valign='top' ><table cellspacing='0' cellpadding='0' width='100%' border='0'>
      <tbody>
        <tr>
          <td width='448'  valign='middle'><img src='anuncios/header.jpg' alt='ANUNCIA GRATIS EN BUSCAXTREMO - Y OBTEN 100% DE RENTABILIDAD' width='448' height='30' /></td>
        </tr>
      </tbody>
    </table></td>
  </tr>
  <tr>
    <td width='448' valign='top' background='anuncios/bg_anuncio.jpg'><table width='448' border='0'>
      <tr>
        <td width='135' valign='top'><img src='$rowNot[notFoto]' width='135' height='135' /></td>
        <td width='303' valign='top'><div align='justify'>$rowNot[notTexto]</div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width='448' valign='top'><img src='anuncios/footer.jpg' width='448' height='15' /></td>
  </tr>
</table>"
;
}
?>