Home » Database » DB » Bug #227
Wrong Object handle with PHP5
Details
| Submitted | 2003-11-12 08:58 UTC |
|---|---|
| From | maxim at softsolutions dot de |
| Status | Duplicate |
| Package | DB |
| PHP Version | 5.0.0b1 (beta1) |
| OS | SuSE Linux 9.0 |
| Roadmaps | (Not assigned) |
Comments
[2003-11-12 08:58 UTC] maxim at softsolutions dot de
Description:
------------
we use DB for access to MySQL Database. One Problem is that PHP5 does not native support for MySQL. Other Problem is object handle in common.php. Execute a query on Query-function have error: only variable can return by reference value.
Reproduce code:
---------------
// do the db connect
$m_idDB = DB::connect( $szDsn, $p_bPersistant );
$result = $m_idDB->Select("Select * from CLASS");
function &query($query, $params = array()) {
if (sizeof($params) > 0) {
$sth = $this->prepare($query);
if (DB::isError($sth)) {
return $sth;
}
$ret = $this->execute($sth, $params);
$this->freePrepared($sth);
return $ret;
} else {
$result = $this->simpleQuery($query);
if (DB::isError($result) || $result === DB_OK) {
return $result;
} else {
return new DB_result($this, $result);
}
}
}
when i change this function to
function &query($query, $params = array(...
than it works!!!!!!!!!