Strange mssql_fetch strange results
| From: | Peter Johnston | Date: | Wed, 30 Aug 2000 15:26:27 +0000 |
| Subject: | Strange mssql_fetch strange results | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-2304@lists.php.net to get a copy of this message | ||
Using php4 and sql7 on IIS5
An example query:
$query = "SELECT * FROM Products";
$result = mssql_query($query) or die("Couldn't execute query");
while ($row = mssql_fetch_array($result))
{
echo $row["ProductID"];
echo $row["ProductName"]
}
Gives a parse error "expecting
T_STRING' or T_VARIABLE' or
`T_NUM_STRING'"
Of course, echo $row[1]; works, but strangely
echo $row[ProductID]
does as well. This seems to be at odds with all the examples I've seen. Is
it
expected behaviour?? Using list() = each() shows the keys are all correct.
_________________________________
Peter Johnston
Eventi Telematici srl
Via Pirandello 17
20099 Sesto S.Giovanni - MI
Tel. +39 02 26264101
Fax +39 02 24411715