Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/08/2012, 13:56
urameshix
 
Fecha de Ingreso: octubre-2005
Mensajes: 240
Antigüedad: 18 años, 6 meses
Puntos: 1
Respuesta: Problema con una condicional php+mysql

Sería tan sencillo como poner un IF en tu código, algo así:

Código PHP:
if(isset($_GET['id']))
{
    
$id=$_GET['id'];
    
$qry=mysql_query("SELECT * FROM Articulos WHERE id=$id "$con);
    if(!
$qry)
    {
    die(
"Query Failed: "mysql_error());
    }

    while(
$row=mysql_fetch_array($qry))
    {       
        echo 
'<img src="'.$row['imagen'].'" width=" 480" height="200"/>';
        echo 
"<h2>".$row['titulo']."</h2>";
        if(
$row['categoria'] != 1)
        {
              echo 
"<p>".$row['cuerpo']."</p>";
        }
        echo 
"<p>".$row['descripcion']."</p>";       
    }

Espero que te sirva