Ver Mensaje Individual
  #7 (permalink)  
Antiguo 26/06/2008, 03:46
Avatar de eddwinpaz
eddwinpaz
 
Fecha de Ingreso: noviembre-2007
Ubicación: Merida , Venezuela
Mensajes: 1.066
Antigüedad: 16 años, 5 meses
Puntos: 25
Respuesta: evitar ingresar la misma info 2 veces...

Aki ta..

<?php
$link
= mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!
$link) {
die(
'Could not connect: ' . mysql_error());
}
mysql_select_db('mydb');

mysql_query("INSERT INTO mytable (product) values ('kossu')");
printf("Last inserted record has id %d\n", mysql_insert_id());
?>

http://ve.php.net/mysql_insert_id

mysql_insert_id — Get the ID generated from the previous INSERT operation
Description

int mysql_insert_id ([ resource $link_identifier ] )
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
__________________
O nos hacemos miserables o nos hacemos fuertes , la cantidad de trabajo es la misma.