Echo autoincrement id doubt
- by Marcelo
Hi, can I print the id, even if it's autoincrement ? Because the way I'm doing I'm using an empty variable for id.
$id= "";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die ("Não conectou com a base $database");
mysql_query("INSERT INTO table1(id,...)
VALUES ('".$id."',....)")
or die(mysql_error());
mysql_close();
echo "Your id is :";
echo "".$id;
I'm trying to print the id, but it's coming blank. I checked the table and there's an id number there. How can I print it then at?
Thanks for the attention