From:             erik at xpand dot nl
Operating system: Windows Server 2003
PHP version:      5.0.2
PHP Bug Type:     MSSQL related
Bug description:  mssql_fetch_field(result)->column_source same as ->name

Description:
------------
I executed this query with 2 columns which have the same name:
SELECT tbl1.n_MatchID, tbl2.n_MatchID FROM tbl1,tbl2 WHERE (etc)

When I request the fields, the column_source and the name are the same...

Reproduce code:
---------------
$query = "SELECT Infostrada.tFootballMatch.n_MatchID as a,
Infostrada.tFootballMatchDetail.n_MatchID as b FROM
Infostrada.tFootballMatchDetail, Infostrada.tFootballMatch WHERE
Infostrada.tFootballMatch.n_MatchID =
Infostrada.tFootballMatchDetail.n_MatchID";
$result = mssql_query($query) or die();

while($obj = mssql_fetch_field($result)) {
        echo $obj->column_source . "." . $obj->name . "<br>";
}

Expected result:
----------------
tFootballMatch.n_MatchID<br>
tFootballMatchDetail.n_MatchID<br>

($obj->column_source.$obj->name)

Actual result:
--------------
n_MatchID.n_MatchID<br>
n_MatchID.n_MatchID<br>

-- 
Edit bug report at http://bugs.php.net/?id=30322&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30322&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30322&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30322&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30322&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30322&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30322&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30322&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30322&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30322&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30322&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30322&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30322&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30322&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30322&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30322&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30322&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30322&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30322&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30322&r=mysqlcfg

Reply via email to