Ver Mensaje Individual
  #5 (permalink)  
Antiguo 14/05/2011, 01:36
Avatar de s00rk
s00rk
 
Fecha de Ingreso: octubre-2010
Ubicación: Mexico
Mensajes: 238
Antigüedad: 13 años, 5 meses
Puntos: 48
Respuesta: hacer insert si esta bien envie a url siguiente

Usando el metodo de dcreate solamente hacemos una busqueda puse varios parametros en el where por si las dudas tambien pudieramos usar
SELECT MAX(id) FROM xxx
pero por si las dudas preferi hacerlo asi jeje

Código PHP:
<?php
$a
=mysql_query("insert into xxx (id,nombre,fecha,fecha_exp,categoria) values ('$id','$nombre','$fecha','$fecha_exp','$categoria')") or die (mysql_error());
if(
$a){
    
$q mysql_fetch_object(mysql_query("SELECT * FROM xxx WHERE nombre='".$nombre."' and fecha='".$fecha."' and categoria='".$categoria."' Order by id DESC"));
    
$id $q->id;
    
header("location:ver.php?id=".$id."&nombre=".$nombre);
    exit();
}  
?>