Re: IBM's Learning PHP Part 1 tutorial.

From: Date: Wed, 06 Jul 2005 14:20:45 +0000
Subject: Re: IBM's Learning PHP Part 1 tutorial.
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-218205@lists.php.net to get a copy of this message
have to agree with Richard here, its wasting resources bringing back * from the database. Its one of those fundamentals. Only do a select * from... where you actually need all the info. Bill, try read the manual to see how the |mysql_query() returns info. SOmeone has posted the link in this thread! | Richard Davey wrote: >Hello André, > >Wednesday, July 6, 2005, 3:25:37 PM, you wrote: > >AM> Depending on the sittuation, IMHO, COUNT(*) wouldn't be the way to >AM> go. If you need the user's id or somesuch, you have to run an >AM> additional query to get the info. > >But they're returning absolutely nothing in this case - which >(providing username was indexed) would make count() a far quicker and >less expensive query than selecting and bring back data and then doing >absolutely nothing with it (somewhat pointless imho) > >Best regards, > >Richard Davey > >

« previous php.general (#218205) next »