On Tuesday, April 23, 2002, at 03:10 PM, destr0 wrote:
> SELECT LAST_INSERT_ID() as id FROM myTable; > > It returns the last inserted Id, but why does it return that value for > every > row in the table. > > for example. > if there are 5 total records in the table. and the last inserted Id is > 9, if > I run the above query I get: > > +------+ > | id | > +------+ > | 9 | > | 9 | > | 9 | > | 9 | > | 9 | > +------+ When you select anything from a table, using FROM tablename, you will end up with a result for each row in that table, unless you use a WHERE clause. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php