MySQL INSERT quoting
Posted: Fri Jul 11, 2003 3:32 pm
I'm having issues with uprgrading from PHP-4-2.1 to PHP-4.2.2.
For ever I've been using the following syntax:
(Assumptions, $a is an array with index $a[0] containing some data.
db_query is a wrapper function for mysql_query() )
This now gives me the following error:
Why is the inital style now invalid? Why change it in a minor revision and is there per chance an option to enable to the old style via php.ini?
I'm really not wanting to sort through over 300,000+ lines of code for every INSERT and UPDATE query ..
Where can one find a resource that really lists the "proper PHP by the letter" way of coding things? According to four differnt printed books I have on PHP the first version is a proper syntax. I search on pear.php.net last night and they mention nothing in this regard because they use their own VALUES(?,?,?)
Any information is greatly apprecaited, and is this tendency to release security updates that will wreak havoc upon your entire project code base a common issue with PHP?
Thanks in advance!
For ever I've been using the following syntax:
(Assumptions, $a is an array with index $a[0] containing some data.
db_query is a wrapper function for mysql_query() )
Code: Select all
$qid = db_query(" INSERT INTO table (example) VALUES ('$aї0]') ");Now with PHP-4.2.2 the only syntax that will work is:Parse error: parse error, expecting `']''
Code: Select all
$qid = db_query(" INSERT INTO table (example) VALUES ('".$aї"0"]."') ");I'm really not wanting to sort through over 300,000+ lines of code for every INSERT and UPDATE query ..
Where can one find a resource that really lists the "proper PHP by the letter" way of coding things? According to four differnt printed books I have on PHP the first version is a proper syntax. I search on pear.php.net last night and they mention nothing in this regard because they use their own VALUES(?,?,?)
Any information is greatly apprecaited, and is this tendency to release security updates that will wreak havoc upon your entire project code base a common issue with PHP?
Thanks in advance!