hello. everybody
imagine a table called tbl_categorie: just an autoincrementa id and a text field.
I just make a simple insert query in it:
$sql1="INSERT INTO tbl_categorie (categoria) VALUES ('$cat')";
[code=php]
Now I'm wondering: how can I know the value of the latest id???
Or better: is there any difference between the values retruned by next three different "options"???
first option:
[code=php] $sql2 = "SELECT MAX(idcategoria) AS idcategoria FROM tbl_categorie";
second
$idcategoria=mysql_insert_id();
third
$sql="select LAST_INSERT_ID() from tbl_prodotti";
THANX
AKA alomar