I\'ve got this test table:
CREATE TABLE IF NOT EXISTS `test` (
`id` INT(10) AUTO_INCREMENT,
PRIMARY KEY (`id
it work perfectly...try it...
$result = mysql_query("INSERT INTO `test` (`title`) VALUES ('test')");
if ($result) {
$id = mysql_insert_id(); // last inserted id
$result = mysql_query("SELECT * FROM tablename WHERE id = $id") or die(mysql_error());
// return user details
if (mysql_num_rows($result) > 0) {
return mysql_fetch_array($result);
} else {
return false;
}
} else {
return false;
}