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
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Tue Sep 19, 2006 4:09 pm
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?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Sep 19, 2006 5:43 pm
$arr isn't a reference.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Tue Sep 19, 2006 6:00 pm
yea I know...
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Sep 19, 2006 6:07 pm
Well, that's what the error is.
I'm not going to fix it for you.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Tue Sep 19, 2006 8:40 pm
so do I need to change it to return &$arr? Is the problem with adodb?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Sep 19, 2006 10:14 pm
The Ninja Space Goat wrote: so do I need to change it to return &$arr? Is the problem with adodb?
try it.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Tue Sep 19, 2006 10:18 pm
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