Prefixed field names
Posted 17 March 2006 - 11:05 PM
I need to retrieve columns from the same table twice, using aliased names in the query.
When php retrieves a record i would expect ambiguous column names to be prefixed with the table name; ie: table.column, but mysql_fetch_assoc() seems to overwrite the ambigous columns so i only get the data from the last alias of the table.
There must be a way around this, is there a config option / runtime setting?
Posted 19 March 2006 - 07:53 PM
Posted 20 March 2006 - 06:11 AM
SELECT col1, col2, col3, col1 FROM table
$row = mysql_fetch_row()
$col1_firsttime = $row;
$col2 = $row;
$col3 = $row;
$col1_secondtime = $row;
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users