[ale] PHP Guru
Alex Carver
agcarver+ale at acarver.net
Fri Feb 1 10:03:30 EST 2013
On 2/1/2013 01:58, Mike Harrison wrote:
>> still have parentheses and commas in them. This is why I always alias
>> SQL function calls into human readable names if I plan to address the
>> result by name rather than by column number.
>
> Please don't EVER use column numbers, and don't ever use "select *" for
> something in real code. You want to make your database schema and column
> order irrelevant.
>
> And some people in this lists jaws dropped, because they remember when I
> used to do both.
I didn't say I always used them. :P There are uses for column numbers
at very select times. On very rare occasions I use them but for the
most part I use column names. Then again, since all my DB functions are
abstracted, you'd never know whether I was or wasn't using column
numbers. If code is written really well, you shouldn't be able to tell
what I'm using for a database without looking inside the DB abstraction
layer.
I do agree with not using "SELECT *" for a variety of reasons.
More information about the Ale
mailing list