20.03.19 Message: Object of class stdClass could not be converted to string |
Hello Guys, please i need a Light!
I've already read some cases identical as my issue here in the Forum, but i don't get STILL see what should i do. The best answer was: ------------------------------------------------------- eluser]Massaki[/eluser] The variable $var is an object. If you want to show an attribute from the object, then Code: echo $var->name_of_the_attribute ------------------------------------------------------- But i still stuck. I'm using this block of code from the documentation: https://www.codeigniter.com/user_guide/d...esult-rows This is my Controller/Method _____________________________ Code: public function votecounting($page = 'vote_detail1') This is my Model _____________________________ Code: public function totalparticipants() This is my VIEW _____________________________ Code: <div class="XXX"> If i try to show the variable this way: <?php echo $totalrows; ?> i got the error message. Code: A PHP Error was encountered If i try to show the variable this way: <?php echo $totalrows->v_id; ?> i got the error message. Code: A PHP Error was encountered This is the result of my First print_r() <?php print_r($totalrows); ?> _____________________________ Code: Votes stdClass Object ( [count(v_id)] => 498 ) This is the result of my Second print_r() <?php print_r($totalrows); ?> _____________________________ Code: The number who participated in the Vote yet stdClass Object ( [count(v_id)] => 498 ) 1 VOTER What should i do please? v_id is the table_field_id and i just want to show a single row as explained in the documentation. i've already tried using row_array(), But i stuck the same way. Thank you so much in advance! |
Messages In This Thread |
20.03.19 Message: Object of class stdClass could not be converted to string - by Porto - 03-20-2019, 01:24 AM
RE: 20.03.19 Message: Object of class stdClass could not be converted to string - by InsiteFX - 03-20-2019, 03:54 AM
RE: 20.03.19 Message: Object of class stdClass could not be converted to string - by Porto - 03-20-2019, 04:19 AM
SOLVED: 20.03.19 Message: Object of class stdClass could not be converted to string - by Porto - 03-20-2019, 06:01 AM
RE: 20.03.19 Message: Object of class stdClass could not be converted to string - by Porto - 03-20-2019, 06:02 AM
|