Re: finding a particular record within a MySQL result set

From: Date: Wed, 04 Apr 2007 18:07:58 +0000
Subject: Re: finding a particular record within a MySQL result set
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-252063@lists.php.net to get a copy of this message
I've looked at those, but both approaches requires traversing through the entire mysql result set to create another array ( could be memory intensive if the result set is large...100,000 ? ) -James On Apr 4, 2007, at 1:39 PM, Jim Moseby wrote:
You will probably get a better approach from the mysql list, but from a PHP solution perspective, I'd load up an array with the result set and use key() to get the number. The example at http://php.net/key does exactly that.
Or array_search() :) JM


« previous php.general (#252063) next »