>>> Database field names should not be prefixed with "field_" or "fld_"
or, really, anything.
I've used column (field) prefixing to avoid ambiguity when tables with
some common column names are joined and the data is being retrieved
using the column names (mysql_fetch_assoc(), mysql_fetch_object(), etc).
select * from table1 left join table2 using(stocknum);
If table1 and table2 both have column 'id, what does $result['id']
actually refer to - table1.id or table2.id?
What if both are needed ?
(rhetorical questions :)
Prefixed column names (tbl1_id and tbl2_id) avoids the issue without
getting into numeric index type retrieves (e.g. mysql_fetch_array() ) or
having to code unique column alias' on each select, for example:
select table1.id as tbl1_id, table2.id as tbl2_id from table1 left
join table2 using(stocknum);
On 8/16/[masked]:13 PM, Michael Kimsal wrote:
> Database field names should not be prefixed with "field_" or "fld_"
> or, really, anything.