Subject | Re: [firebird-php] SELECT STAR |
---|---|
Author | Lester Caine |
Post date | 2004-12-13T20:58:30Z |
Dariusz Zelichowski wrote:
two fields --- ID, NAME, AGE
I make that three ;)
It depends on how you are accessing the data within PHP, but if a field
name gets changed in the database, * will access it without problems,
but the application complains. IF you use the field names, then the
SELECT will fail, and it's easier to find the problem. Speed wise there
is not a lot of difference, but good programming practice would be to
always use the names.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
> A little silly question at first sight, but I'm puttingActually, you give a good example of why it's nice to use the names -
> together a site (PHP/Firebird), and I have some very basic
> question:
>
> Let's say I have one table, containing two fields: ID,
> NAME, AGE. I need to fetch ALL field ONLY from this one
> table and nothing more from any other tables. Values for
> all fields need to be displayed.
>
> Are there any technical reasons in this particular case
> (speed, efficiency of FB's databse engine) of using:
>
> SELECT ID, NAME, AGE
>
> as opposed to just
>
> SELECT *
two fields --- ID, NAME, AGE
I make that three ;)
It depends on how you are accessing the data within PHP, but if a field
name gets changed in the database, * will access it without problems,
but the application complains. IF you use the field names, then the
SELECT will fail, and it's easier to find the problem. Speed wise there
is not a lot of difference, but good programming practice would be to
always use the names.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services