Ver Mensaje Individual
  #14 (permalink)  
Antiguo 01/11/2008, 08:14
Avatar de Wilfred
Wilfred
 
Fecha de Ingreso: octubre-2008
Mensajes: 110
Antigüedad: 15 años, 6 meses
Puntos: 1
Respuesta: Obtener id mediante GET

ya lo consegui solo tuve ke pensar un poco mucho xD
aki list php:
Código:
<link href="css2.css" rel="stylesheet" type="text/css" />

<?php
include('db-cnx.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'";
    // 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, notTexto,fecha,DATE_FORMAT(fecha,'%d-%m-%y ') AS fecha FROM sn_noticias ORDER BY not_ID DESC limit 3 
                            $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 substr($rowNot['notTexto'], 10, 150);
	echo "<span class='Estilo4'>Escrito el: </span><span class='Estilo5'>$rowNot[fecha]</span>";
	echo "<a href=ver.php?id=$rowNot[not_id]>Leer más</a>" ;
}
?>
AQUI VER PHP:
Código:
   
      <?
	   $id=$_GET[id];
  
include('db-cnx.php');
  
    
  
    
  
      $result=mysql_query("select * from sn_noticias where not_id='$id'",$db_link);
  
    //Una vez seleccionado el registro, mostramos la noticia completamente
 
      while($row=mysql_fetch_array($result)) {
 
      echo "<h2>".$row[notTitulo]."</h2><br>
 
      <p>".$row[notTexto]."</p><br>
 
      <div>";
  
      }
  
      mysql_free_result($result);
 
      ?>