1
Hmm, I have often seen this code in XOOPS I dont understand really:
$connectionId =& mysql_connect(...);
// OR
$result =& mysql_query(...);
// OR
$handle =& fopen(...);
?>
Why do u want a reference to a resource id which is already a reference (better: it is an identifier which points to an entry in the referencetable)? Actually a resource id is only a number with a resourcetype like stream, so no big object you have to worry about. You can test this with intval($yourResource). So whats the magic behind it?
Samplecode from mysqldatabase.php (XOOPS):
function &queryF($sql, $limit=0, $start=0) {
if ( !empty($limit) ) {
if (empty($start)) {
$start = 0;
}
$sql = $sql. ' LIMIT '.(int)$start.', '.(int)$limit;
}
[b]$result =& mysql_query($sql, $this->conn);[/b]
if ( $result ) {
$this->logger->addQuery($sql);
return $result;
} else {
$this->logger->addQuery($sql, $this->error(), $this->errno());
return false;
}
}
?>
Thanks for your comments! :)
.:Buster