Re: Looping problem?

From: Date: Tue, 06 Jan 2004 22:43:49 +0000
Subject: Re: Looping problem?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-173922@lists.php.net to get a copy of this message
On Tue, Jan 06, 2004 at 05:33:41PM -0500, joel boonstra wrote: <snip> > I would recommend not simply doing a select *, but rather specifying > which columns you want. That way, if your database schema changes > (e.g., you add two more columns), your code won't break. And, responding to myself, specifying your columns is also good practice because MySQL makes no guarantees about the order that columns are returned when you say "SELECT *". Today, it may well be the order that you specified when you created your table. With the next upgrade, it may be alphabetical order, or by column type, or some other order that the software chooses. If you specify column names in your SELECT statement, you don't need to worry about it. This is especially important when you are using list() to assign variables based on their position in your fetched array. joel -- [ joel boonstra | gospelcom.net ]

« previous php.general (#173922) next »