> Forgot to ask - does referencing an array with double quotes
> around the key work for arrays not associated with a MySQL
> result? I doubt it's specific to MySQL result arrays, but
> it doesn't hurt to check. Make a small array and test.
I grabbed an example of of php.net dealing with just arrays and it works ...
Here's what I'm seeing - THIS WORKS:
<HTML>
<HEAD>
<TITLE>mysqltest</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?
require($DOCUMENT_ROOT . "/subs/sub.php");
openDSN();
echo "<table>\n";
$rslt = mysql_query("select * from pricing");
while ( $row = mysql_fetch_array($rslt) )
{
echo "<TR>\n";
echo "<TD>$row[ID]</tD>";
echo "<TD>$row[ProdCode]</tD>";
echo "<TD>$row[Price_effdate]</tD>";
echo "<TD>$row[ProdSetup]</tD>";
echo "<TD>$row[ProdMonthly]</tD>";
echo "<TD>$row[5]</tD>";
echo "</TR>\n";
}
echo "</table>\n";
?>
</BODY>
</HTML>
But put any one of these $row[...] with quotes around their fieldnames and I
get:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/testnexus/public_html/test.php on line 16
(when line 16 =
echo "<TD>$row["ID"]</tD>";
)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]