Ver Mensaje Individual
  #16 (permalink)  
Antiguo 11/03/2011, 01:39
Avatar de Marvin
Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 19 años, 3 meses
Puntos: 81
Respuesta: Cambiar /articulo.php?id=X por /titulo-del-articulo

Creo que tu primer codigo para esto que quieres hacer ahora estaba bien pero debes agregar algunas cosas:
Código PHP:
$query "SELECT * from articulos where id = $id"
//$echo = mysql_error(); //ESTA NO LA NECESITAS
//A ESTA LE AGREGAS UN @
$result = @mysql_query($query); 
//EN CASO QUE TENGA ERRORES NO LOS MOSTRARA EN LA PAGINA
//ACA TOMAS EL NUMERO DE REGISTROS ENCONTRADOS Y TAMBIEN AGREGA @
$num_rows = @mysql_num_rows($result); 
//CAMBIA EL == POR <= 
if ($num_rows <= 0) {
    include 
"404.php";
    die(); 
//CAMBIA EXIT POR DIE ASI NO EJECUTAS NADA MAS

Suerte!
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!