Re: Mysql Help #2

From: Date: Thu, 02 Aug 2001 11:14:44 +0000
Subject: Re: Mysql Help #2
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60889@lists.php.net to get a copy of this message
Depends what is to happen to the array afterwards, but in general no. An interesting thing is to put timing method calls around a block of code in question, you will find something like this (depending upon size of db) takes somehting like 0.005 seconds. Timing things can be useful measures of a pages overhead (one page on a site I hvae currently takes almost 2 seconds on average to build...eek!) "elias" <elias_bachaalany@yahoo.com> wrote in message ----- Original Message ----- From: "elias" <elias_bachaalany@yahoo.com> To: <php-general@lists.php.net> Sent: Thursday, August 02, 2001 9:31 AM Subject: [PHP] Mysql Help #2 > Hi again. > > $result = mysql_query("SELECT id FROM table"); > $id_array = array(); > > while ($r = mysql_fetch_array($result)) > $id_array[] = $r["id"]; > > // now $id_array[] is an array of IDs that was grabbed from the database. > > Any faster and/or better approache to build the $id_array? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#60889) next »