Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Some help with object issues? (http://www.mysidiaadoptables.com/forum/showthread.php?t=5403)

Abronsyth 04-02-2017 01:27 PM

Some help with object issues?
 
Wow, another issue! Surprise!

Okay, I'll cut to the chase, I am having issues with this line;
PHP Code:

$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).

Abronsyth 04-04-2017 07:55 PM

Figured it out after a lot of playing!

Turns out it is not supposed to be object, instead it is this;
PHP Code:

$bg $mysidia->db->select("owned_adoptables", array("adoptbackground"), "aid = '{$adopt->aid}'")->fetchColumn(); 

Works perfectly now!

Kaeliah 04-04-2017 10:37 PM

Thanks for sharing your solution. :)


All times are GMT -5. The time now is 03:09 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.