If the table has an auto_increment column defined - you can check by looking for "auto_increment" in the output from DESC your_table
, use:
mysql_insert_id
Otherwise, you have these options:
SELECT MAX(id) FROM your_table
SELECT id FROM your_table ORDER BY id LIMIT 1