|
Posted by J.O. Aho on 12/04/07 05:30
bender wrote:
> In PHP4 was mysql_result which produced resultset with
> tableName.fieldName (if my memory is good:
> $mysql_result($rs,$i,tableName.fieldName)) and I wonder if is possible
> to get in PHP5 with mysqli?
I can say I never got that in PHP4 nor PHP5. FRom the manual for
mysql_fetch_array:
If two or more columns of the result have the same field names, the last
column will take precedence. To access the other column(s) of the same name,
you must use the numeric index of the column or make an alias for the column.
For aliased columns, you cannot access the contents with the original column name.
and mysqli_fetch_array:
If two or more columns of the result have the same field names, the last
column will take precedence and overwrite the earlier data. In order to access
multiple columns with the same name, the numerically indexed version of the
row must be used.
So you will need to use AS in the query if you want to emulate the tablename
included in the column name.
--
//Aho
[Back to original message]
|