How to get the last record ID? I'm inserting values using user_save(). I have used this, but it is returning the wrong values.

SELECT LAST_INSERT_ID() FROM &lt;table name&gt;


How can I get the ID of the last record user_save()inserted?
First you acquire the user object by using its return value and then you read the uid, which is also the unique value that belongs to the database row:

$user = user_save($user_obj);
$id = $user-&gt;uid;