Adodb error notice

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Adodb error notice

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

$arr isn't a reference.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

yea I know... :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Well, that's what the error is. :? I'm not going to fix it for you. :P
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

so do I need to change it to return &$arr? Is the problem with adodb?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The Ninja Space Goat wrote:so do I need to change it to return &$arr? Is the problem with adodb?
try it.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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
Post Reply