Some help with object issues?

Forum
Last Post
Threads / Messages

Abronsyth

A Headache Embodied
Member
Joined
Aug 25, 2011
Messages
1,012
Points
36
Location
NY
Mysidian Dollar
73,285
Wow, another issue! Surprise!

Okay, I'll cut to the chase, I am having issues with this line;
PHP:
$bg = $mysidia->db->select("owned_adoptables", array("adoptbackground"), "aid" = '{$adopt->aid}')->fetchObject();

I'm trying to select the data listed in owned_adoptables under adoptbackground

I am getting this error when I try to call it:
Catchable fatal error: Object of class stdClass could not be converted to string in .../public_html/view/myadoptsview.php on line 312

Could someone possibly point out my error?
(For reference, I am making a new function on the myadopts/manage page to remove an item (background) from an adoptable. It needs to distinguish between whether or not the adoptable has a background already so that it doesn't give them an item they don't have).
 
Figured it out after a lot of playing!

Turns out it is not supposed to be object, instead it is this;
PHP:
$bg = $mysidia->db->select("owned_adoptables", array("adoptbackground"), "aid = '{$adopt->aid}'")->fetchColumn();

Works perfectly now!
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top