Finding next unique id in mysql with php?
I am trying to find the next unique id in mysql with php but can't find
the right method and/or get the right syntax such as..
$lastid =mysql_query("SELECT LAST_INSERT_ID() FROM panomap",$link);
The problem comes when the last marker was deleted and I open the map
for the first time.
For example, the last marker has id 9 but the next marker will be id 11
since marker 10 was deleted.
I add a marker, but I can only know the last marker's id of 9 so I have
to guess the next marker will be id 10, causing problems when I try to
update the record of the last marker.
Does anyone know how to find out what the next id will be with a query
in php?
s
0 Comments:
Yorum Gönder
<< Home