Welcome Guest, Not a member yet? Register   Sign In
Database results will not display. New to CI
#3

[eluser]Dam1an[/eluser]
[quote author="Stelian Mocanita" date="1240694940"]
Code:
$query = $this->db->get('questions');
$data['query'] = $query->result_array();

That will convert yout mysql resource into the array you need.[/quote]

But he's using the query object in the view (num_rows)
And he's using it as an object, not an array

Changing the foreach loop to be
Code:
<?php foreach($query->result() as $row): ?>
should fix it


Messages In This Thread
Database results will not display. New to CI - by El Forum - 04-25-2009, 10:00 AM
Database results will not display. New to CI - by El Forum - 04-25-2009, 10:29 AM
Database results will not display. New to CI - by El Forum - 04-25-2009, 11:19 AM
Database results will not display. New to CI - by El Forum - 04-25-2009, 12:37 PM
Database results will not display. New to CI - by El Forum - 04-25-2009, 12:43 PM
Database results will not display. New to CI - by El Forum - 04-25-2009, 06:10 PM
Database results will not display. New to CI - by El Forum - 04-26-2009, 04:46 AM
Database results will not display. New to CI - by El Forum - 04-26-2009, 12:34 PM
Database results will not display. New to CI - by El Forum - 04-26-2009, 12:36 PM
Database results will not display. New to CI - by El Forum - 04-26-2009, 12:37 PM
Database results will not display. New to CI - by El Forum - 04-26-2009, 12:47 PM
Database results will not display. New to CI - by El Forum - 04-27-2009, 12:39 PM
Database results will not display. New to CI - by El Forum - 04-27-2009, 01:17 PM
Database results will not display. New to CI - by El Forum - 04-27-2009, 03:10 PM
Database results will not display. New to CI - by El Forum - 04-27-2009, 10:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB