PHP 4.2.3 MySQL mysql_query quoting syntax.

From: Date: Thu, 10 Jul 2003 23:52:56 +0000
Subject: PHP 4.2.3 MySQL mysql_query quoting syntax.
Groups: php.db 
Request: Send a blank email to php-db+get-29194@lists.php.net to get a copy of this message
Greetings, 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 ;.,

« previous php.db (#29194) next »