Page 2 of 2
Posted: Sat Aug 07, 2004 11:27 am
by anjanesh
Are you sure you tried this in MySQL ?
By the way my MySQL ver is 4.0 and perhaps I thought that it'll be there in 4.1 or 5.0 like subselects (select within select which is supported only from 4.1) but there is nothing in the manual search.
Posted: Sat Aug 07, 2004 11:28 am
by Joe
Yeah I have seen it in action before im sure however, that was in college and I was not entirly sure of the setup!
Posted: Sat Aug 07, 2004 11:34 am
by feyd
[php_man]mysql_insert_id[/php_man]()

Posted: Sat Aug 07, 2004 11:46 am
by Joe
Well thats another option feyd

Something like:
Code: Select all
<?php
mysql_query("INSERT INTO Table1 VALUES ('',$Name)");
$ID= mysql_insert_id();
mysql_query("INSERT INTO Table2 VALUES ($ID,$Pass)");
?>
Posted: Sat Aug 07, 2004 11:50 am
by anjanesh
Yes. But Im just afraid if there is a possibility that the last inserted id may not be actual last inserted id if some 100 users are adding the db at the same moment. The manual gives a lot of explanation to that but still..........not so sure[/pg_man]