Welcome Guest, Not a member yet? Register   Sign In
object(CI_DB_mysql_result)#22 (7) { ["conn_id"]=>....
#1

[eluser]phpmonster[/eluser]
I am able to insert into the database but when I query the database with:

Code:
$query['results'] = $this->db->query('SELECT * FROM products');

I get:

Quote:object(CI_DB_mysql_result)#22 (7) { ["conn_id"]=> resource(32) of type (mysql link persistent) ["result_id"]=> resource(49) of type (mysql result) ["result_array"]=> array(0) { } ["result_object"]=> array(0) { } ["current_row"]=> int(0) ["num_rows"]=> int(2) ["row_data"]=> NULL }
#2

[eluser]sooner[/eluser]
look at this http://ellislab.com/codeigniter/user-gui...sults.html. i think you need to use result $query = $this->db->query('SELECT * FROM products'); $query['results']=$query->result();
#3

[eluser]phpmonster[/eluser]
[quote author="sooner" date="1293159025"]look at this http://ellislab.com/codeigniter/user-gui...sults.html. i think you need to use result $query = $this->db->query('SELECT * FROM products'); $query['results']=$query->result();[/quote]

Thanks for your reply;
I just tried that and I get the exact same error.

I don't understand, it's a clean install with ion auth installed.

Inserting into the db works but querying it gets the message above.
#4

[eluser]sooner[/eluser]
for me it doesn't seem like an error.But i am not sure.May be some one would help.
#5

[eluser]Federico BaƱa[/eluser]
you're doing var_dump on the query object, as @sooner said, you need to get the result from it.
Code:
$query = $this->db->query(...);
$actual_rows = $query->result();
var_dump($actual_rows);
#6

[eluser]phpmonster[/eluser]
That did it - I was goofing up ... and indeed I had a var_dump() line I removed as well.

Thanks for your help.




Theme © iAndrew 2016 - Forum software by © MyBB