PDA

View Full Version : Get the value of the primary key?


uncleroxk
12-03-2008, 05:21 AM
Hi, i have a query string like this and the first value of the TABLE is an auto increment(Primary key), I want to get of the Primary Key of the result after i have sucessfully Insert into the table, how do i do it?

//mysql configuration here..

$sql = "Insert Into TABLE Values(null, '$name', '$date')";
$result = $conn->query($sql);

guelphdad
12-03-2008, 06:01 AM
last_insert_id()