Last incremented value
Posted: Tue May 27, 2003 4:16 am
I am getting email address of a user from a feedback form and wish to generate a visitor number from that. I have tried inserting the email in a database and would like to get the last incremented value how do i get the same.
Code: Select all
<?php
$email = $_POST["email"];
$db = mysql_connect("localhost", "root");
mysql_select_db("visitor",$db);
$sql = "INSERT INTO invoice (email) VALUES ('$email')";
$result = mysql_query($sql);
mysql_insert_id();
echo "Thank you! Information entered.\n";
?>