2009-09-01 MySQL 直前のIDを知るには・・・ mysql_insert_id() を使う。 例: $sql = "SELECT * FROM a_table posts WHERE id = '". mysql_insert_id() . "';";