Page 1 of 1

Adodb error notice

Posted: Tue Sep 19, 2006 4:09 pm
by Luke
I am getting this notice... and adodb is not loading an active record even though I looked at the query it is performing and the quere is structurally FINE...
error wrote:Notice: Only variable references should be returned by reference in /path/to/library/adodb/adodb.inc.php on line 1425
My code:

Code: Select all

function findByUsername($username){
		$this->load("`username` = '" . $this->qstr($username) . "'");
		return $this->isLoaded();
	}
Relevent adodb code:

Code: Select all

function &GetRow($sql,$inputarr=false)
	{
	global $ADODB_COUNTRECS;
		$crecs = $ADODB_COUNTRECS;
		$ADODB_COUNTRECS = false;
		
		$rs =& $this->Execute($sql,$inputarr);
		
		$ADODB_COUNTRECS = $crecs;
		if ($rs) {
			if (!$rs->EOF) $arr = $rs->fields;
			else $arr = array();
			$rs->Close();
			return $arr; // LINE 1425
		}
		
		$false = false;
		return $false;
	}
Anybody know what could be causing this error? (php4)

EDIT: This may seem unrelated... but does parent::__construct() work in php4 if you replace __construct with the parent's class name?

Posted: Tue Sep 19, 2006 5:43 pm
by feyd
$arr isn't a reference.

Posted: Tue Sep 19, 2006 6:00 pm
by Luke
yea I know... :?

Posted: Tue Sep 19, 2006 6:07 pm
by feyd
Well, that's what the error is. :? I'm not going to fix it for you. :P

Posted: Tue Sep 19, 2006 8:40 pm
by Luke
so do I need to change it to return &$arr? Is the problem with adodb?

Posted: Tue Sep 19, 2006 10:14 pm
by feyd
The Ninja Space Goat wrote:so do I need to change it to return &$arr? Is the problem with adodb?
try it.

Posted: Tue Sep 19, 2006 10:18 pm
by Luke
yea I guess that was kind of a stupid question... I just don't want to change it and then have a bunch of bugs pop up a month down the road... I'll give it a try