I currently have a php set up for a high-scores list. The mysql database has 3 fields. 1-id 2-Name 3-Score
id is set to auto increment
ive got it working to properly input name and score into the database and it automatically gives the entry an "id"...
heres the code:
$dbc = mysql_connect('ZShiscoreapp.db.10895904.hostedresource.com','username','password');
if (!$dbc) {
die('Not Connected :' .mysql_error());
}
$db_selected = mysql_select_db("ZShiscoreapp", $dbc);
if (!$db_selected)
{
die("Cant Connect : " .mysql_error);
}
$pname=$_GET['nameinput'];
$pscore=$_GET['scoreinput'];
$query="INSERT INTO highs SET Score='$pscore', Name='$pname' ";
$result=mysql_query($query);
I want to get the assigned "id" from the database and print it. how can i do this?