![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
01/07/2009, 15:58
|
| | Fecha de Ingreso: junio-2009
Mensajes: 18
Antigüedad: 15 años, 7 meses Puntos: 0 | |
Respuesta: como mando a imprimir un dato que se acaba de guardar en la BBD chelitoz, mysql_insert_id no hace lo que indicas. Revisa h t t p : / / w w w .php.net/mysql_insert_id (quitale los espacios en blanco a la url)
<?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());
?> |