Before we begin I should point out that the debug function does a print_r on the array, the numbers are used like error levels and are irrelivant to the question.
The above code deals with the value $this->db_used which is a class wide variable. It carries TRUE when the resource $this->db_conn has been successfully used to connect to the correct database.Code:$this->debug("db_connect-mid:", array($this->db_conn, $this->db_used), 5); if ($this->db_used == 'none'){ $this->debug("db_connect-used:", array($this->db_conn, $this->db_used), 4); ...
This section of code makes the connection if it is not there. It only has the information to do this when it should logicly need to (if it is the first in the chain as everything else passes by value the content of the two class scope variable).
The debug output both before and after "if ($this->db_used == 'none')" show a value of 1
How then are we dealing with code inside the IF?Code:DEBUG level: 5 Class: responder db_connect-mid: Array ( [0] => Resource id #5 [1] => 1 ) DEBUG level: 4 Class: responder db_connect-used: Array ( [0] => Resource id #5 [1] => 1 )
It is beating me at the moment.





Reply With Quote