Re: Call to a member function on a non-object

From: Date: Tue, 08 May 2001 08:34:37 +0000
Subject: Re: Call to a member function on a non-object
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-51871@lists.php.net to get a copy of this message
Hi, $db is not an object, but a link identifier returned by mysql_connect(). Wieger Ender wrote: > > Okay I get the: Call to a member function on a non-object error when trying to execute this > script: > > It happens in this area: > > $db=mysql_connect(localhost,'***','***') or die("Unable to connect to > database"); > > $edlist = new EditList("serverId", "hlstats_Servers", "server"); > $edlist->columns[] = new EditListColumn("game", "Game", 0, true, > "hidden", $gamecode); > $edlist->columns[] = new EditListColumn("address", "IP Address", 15, > true, "ipaddress", "", 15); > $edlist->columns[] = new EditListColumn("port", "Port", 5, true, > "text", "27015", 5); > $edlist->columns[] = new EditListColumn("name", "Server Name", 22, > true, "text", "", 64); > $edlist->columns[] = new EditListColumn("rcon_password", "Rcon > Password", 10, false, "text", "", 48); > $edlist->columns[] = new EditListColumn("publicaddress", "Public > Address", 20, false, "text", "", 64); > $edlist->columns[] = new EditListColumn("statusurl", "Status URL", 20, > false, "text", "", 255); > > > if ($HTTP_POST_VARS) > { > if ($edlist->update()) > message("success", "Operation successful."); > else > message("warning", $edlist->error()); > } > > ?> > Enter the addresses of all servers that you want to accept data from here.<p> > > <?php > > $result = $db->query(" > SELECT > serverId, > address, > port, > name, > publicaddress, > statusurl, > rcon_password > FROM > hlstats_Servers > WHERE > game='cstrike' > ORDER BY > address ASC, > port ASC > "); > > More specificially it happens on this line: $result = $db->query(" > > What am I doing wrong here? > > Best regards, > > Ender [Clan Leader] > ender@particlesun.com -- Wieger Uffink tel: +31 20 428 6868 fax: +31 20 470 6905 web: http://www.usmedia.nl

« previous php.general (#51871) next »