Código PHP:
<?php
$consulta=mysql_query("SELECT * FROM prensa ORDER by fecha DESC") or die(mysql_error());
while($mostrar=mysql_fetch_array($consulta)){
$id=$mostrar['id_prensa'];
$titulo=$mostrar['titulo'];
$desc=$mostrar['descripcion'];
$enlace=$mostrar['enlace'];
$imagen=$mostrar['imagen'];
$fecha=$mostrar['fecha'];
$cat=$mostrar['categoria'];
?>
Código PHP:
<?php
$consulta=mysql_query("SELECT * FROM prensa ORDER by fecha DESC WHERE categoria=" .$catpres) or die(mysql_error());
while($mostrar=mysql_fetch_array($consulta)){
$id=$mostrar['id_prensa'];
$titulo=$mostrar['titulo'];
$desc=$mostrar['descripcion'];
$enlace=$mostrar['enlace'];
$imagen=$mostrar['imagen'];
$fecha=$mostrar['fecha'];
$cat=$mostrar['categoria'];
?>
Cita:
Pero no veo el falloYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE categoria=blog' at line 1
Espero respuestas, gracias