|
Posted by plaidthermos on 02/22/06 21:44
i found a topic on this question posted a couple years ago, but it
didn't really help me. my problem is the same as the original
poster's, that is, i have a query that returns multiple fields with the
same name. i need to access these in php via mysql_fetch_assoc, like
$row["field_name"]. the only response suggested using aliases in the
select, but that is not really practical, as i am selecting * from all
tables, and writing
select t1.field1 as t1f1, t2.field1 as t2f1, t1.field2 as t1f2,
t2.field2 as t2f2, t1.field3 as t1f3 ... t1.field100 as on and on and
on
is hardly desirable. does anyone know a way to access these fields
from php without specifying aliases in the sql select statement? i
don't really want to use field indices, as the table structure could
change and just because table.field1 is the first field in the table
today doesn't mean it always will be in that same position.
any solutions?
thanks,
-k
Navigation:
[Reply to this message]
|