You can use mysql_insert_id() to get the number right after you do an INSERT.
$result = mysql_query("INSERT INTO ...");
$id_num = mysql_insert_id($link_id);
where $link_id is what's returned from mysql_connect();
If you're not looking for the number directly after your insert, then you can use this query:
SELECT MAX(id) FROM table;
---John Holmes...