Welcome Guest, Not a member yet? Register   Sign In
20.03.19 Message: Object of class stdClass could not be converted to string
#3

(03-20-2019, 03:54 AM)InsiteFX Wrote: SEE:

CodeIgniter User's Guide - Generating Query Results

Hello InsiteFX,

I thank you to send me back to the documentation, but, unfortunatly this doens't helped me! This is the Standardt error that i get!

PHP Code:
A PHP Error was encountered
Severity
4096

Message
Object of class stdClass could not be converted to string

Filename
models/Voting_counter_model.php

Line Number
183 

I know that it would be such a ridiculous question, but i need to ask anyway because there is no ridiculous question in this world.

This is the first example from CI documentation - Result Arrays

Where should go where please?

The first line belongs to the CI Model file:

Code:
1° $query = $this->db->query("YOUR QUERY");

Where should go this "foreach" please? Does it work together with the line above in the same file "model file" or does he go to the view file?

Code:
foreach ($query->result() as $row)
{
       echo $row->title;
       echo $row->name;
       echo $row->body;
}

I will try to practice every example from the Database Reference page,
https://www.codeigniter.com/user_guide/d...index.html

because if you just are not programmer 25 hours a day, it comes a moment that you forget the simple things.

Thank you!
Reply


Messages In This Thread
RE: 20.03.19 Message: Object of class stdClass could not be converted to string - by Porto - 03-20-2019, 04:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB