A small problem in running PHP4 under PHP5 - $row[fieldname]



I have just upgraded my php version form php4 to php5. and I met this
problem, and don't know if you know the solution.
My site was written in PHP4, and most parts can be running smoothly in
PHP5, only that in old version, I can use $row[fieldname] to access
the data in database directly, no need to put double quote around
fieldname. BUT in PHP5, this is wrong, I got error message "undefined
constant". I know this is because PHP5 see the fieldname without
double quote as constant instead of name of field. I know the slowest
solution is to add double quotes one by one, but this will take a lot
time.
So are there any solution to change configuration in php.ini and let
PHP5 accept this kind of usage just like that in PHP4?
Thanks.

.



Relevant Pages

  • Re: [PHP] PHP4 vs PHP5 Performance?
    ... in PHP4 that was then duplicated b internal code in PHP5. ... PHP4 AND PHP5 developers don't even use OOP. ... in a pre-existing PHP encoded database abstraction layer. ...
    (php.general)
  • Re: [PHP] PHP4 vs PHP5 Performance?
    ... PHP5 being faster than PHP4 is greatly dependent on what features you ... I've consistently found PHP4 to be faster for my purposes also. ... I've been doing a lot of benchmarking with Apache to compare ... Also PHP on Apache1 was much faster than on Apache2. ...
    (php.general)
  • Re: [PHP] Zend (or other) Framework...where to start?
    ... Will PHP5 support PHP4 backward compatibility ... Altough, I agree with you we don't need to implement all new features, ...
    (php.general)
  • Re: [PHP] Why PHP4?
    ... lot of mistakes were made when php5 came out but how can a language grow up ... I still think PHP is moving the right way. ... But at work we are stuck with some small legacy applications. ... And some major applications written on top of PHP4. ...
    (php.general)
  • Suggestion for porting function to PHP5??
    ... called DBConn (this is the PHP5 ported definition for the members, PHP4 ... private $bConnected; //db link status ... escape_string function connection when necessary. ...
    (comp.lang.php)