Re: PHP + MySQL - Load last inserts

From: Date: Mon, 30 Mar 2009 22:48:36 +0000
Subject: Re: PHP + MySQL - Load last inserts
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-290870@lists.php.net to get a copy of this message
The physical order of the rows changed (as you can see) but it does not re-use the id's that were deleted. Ordering by the id will get you the last bunch inserted. If you're using innodb you'll have to be aware it's transaction specific, if you're using myisam it will be system wide.
I'll have to check my DBs then, because the exact situation I described happened to me a few years back when I was first getting into the DB scene. Regardless, I'm fairly certain the MSSQL box we have at work behaves this way.
Maybe it's a version thing, that test was done on mysql 5 (I'm sure it'll work on mysql 4.0/4.1 as well). No idea about ones before that. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#290870) next »