Prior to PHP 4.2.3, when inserting values from an array into mysql I could
do the following:
(assuming that $a is an array())

$qid = mysql_query(" INSERT  INTO  table  (info)  VALUES ('$a[2]')  ");

However this logic now fails with the following error:
Parse error: parse error, expecting `']'' in /path/to/script/my_query.php on
line 123

Thus making me have to rewrite the query as:

$qid = mysql_query(" INSERT  INTO  table  (info)  VALUES ( ' ".$a["2"]." ' )

What happened?  Is this just a PHP.INI setting, or was PHP just being
leanent and now it's gotten strict and being a bully about this?  .. I would
really prefer not to have to re-write my entire projects queries because of
this change.  Any information on how to go back to the old behaviour or why
the old behaviour is now unacceptable are greatly apprecaited.

    Thank you,
-V. Twilight ;.,

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to