ok in questo caso ti va bene, ma fai attenzione che se l'id e' tipo bigint non funziona correttamente a causa del typecasting eseguito( l'intero grande non e' esprimibile in un intero normale e php non sa la differenze e potresti andare in overflow)
Just to be safe :
1- controlla la doc ufficiale dove spiegano questa cosa :
http://it.php.net/manual/en/function...-insert-id.php
e come suggerito ecco il workaroudmysql_insert_id() will convert the return type of the native MySQL C API function mysql_insert_id() to a type of long (named int in PHP). If your AUTO_INCREMENT column has a column type of BIGINT (64 bits) the conversion may result in an incorrect value. Instead, use the internal MySQL SQL function LAST_INSERT_ID() in an SQL query. For more information about PHP's maximum integer values, please see the integer documentation.
Codice PHP:
<?php
function tableLastInsertId($table)
{
$q = "SELECT LAST_INSERT_ID() FROM $table";
return mysql_num_rows(mysql_query($q)) ;
}
?>