Re: [PHP4BETA] Bug or intentional change?

From: Date: Tue, 10 Aug 1999 21:53:38 +0000
Subject: Re: [PHP4BETA] Bug or intentional change?
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-3316@lists.php.net to get a copy of this message
At 22:48 10/08/99 , Eric Mings wrote:
I recently posted about a problem that has developed since upgrading php 4 to beta2 where phplib mysql connections were failing. The error message I would receive on any page where phplib was establishing a connection to mysql was: Database error: Invalid SQL: MySQL Error: 1065 (Query was empty) Session halted. Thanks to help from another list member I have been able to identify the code problem in db_mysql.inc and replace it with code that works. Here is the code that _did_ work in all prior versions of php but now yields the abover error: /* public: constructor */ function DB_Sql($query = "") {
    $this->query($query);
} Here is the code supplied to me by another list member that appears to work with php4 beta2 (though I don't know if there are unexpected side effects of this change): /* public: constructor */ function DB_Sql($query = "") {
    if (!empty($query)) {
      $this->query($query);
    }
} Is this the result of some intentional change in php4 beta2 or a bug? Anyone know if there are "surprise" effects of using this code with phplib 7?
Hmm, perhaps Kristian can comment on this? It seems to me that sending an empty query isn't a good thing. Are you sure the only thing you changed was PHP? In particular, are you sure you didn't upgrade MySQL at the same time? Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il

« previous php.version4 (#3316) next »