가능한 중복 :
PHP: how to get last inserted ID of a table?AUTO_INCREMENT 2의 테이블
내가 양식을 만들어 두 테이블에 데이터를 기록 할 수 있습니다.
$sql = "INSERT INTO ma_forum (notcat_id, usr_id, not_titulo, not_status, not_tags, not_data, not_comentarios, not_resumo, not_texto)
VALUES('$categoria', '".$_SESSION[usr_name]."', '$titulo', '$status', '$tags', '".time()."', '$comentarios', '$resumo', '$texto')";
$res = mysql_query($sql) or die(mysql_error());
$sql_or = "INSERT INTO ma_forum_comentarios (comnot_habbo, comnot_data, comnot_status) VALUES('$_SESSION[usr_name]', '".time()."', '$status_comnot')";
$res = mysql_query($sql_or) or die(mysql_error());
그러나 첫 번째 표에는 auto_increment ID가 자동으로 기록됩니다. 하지만 첫 번째 테이블과 다른 열의 ID를 입력하고 싶습니다. 누구나 할 줄 알아?