How to get the last record ID?
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;