Why this code doesn't work?
Posted: Fri May 31, 2002 9:16 am
(for context purposes)
$Con = new COM("ADODB.Connection") or die ("Error");
$Con->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.MDB");
$Qry = $Con->Execute($SQL); // Recordset
This code works
$F = $Qry->Fields(0);
$FieldValue = $F->value;
But I would rather write
$FieldValue=$Qry->Fields(0)->value;
for which PHP complains with the following message:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in line...
Can you tell me why?
$Con = new COM("ADODB.Connection") or die ("Error");
$Con->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.MDB");
$Qry = $Con->Execute($SQL); // Recordset
This code works
$F = $Qry->Fields(0);
$FieldValue = $F->value;
But I would rather write
$FieldValue=$Qry->Fields(0)->value;
for which PHP complains with the following message:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in line...
Can you tell me why?