Welcome Guest, Not a member yet? Register   Sign In
Possibly bug or incorrect code?
#1

Query returns only one row in table (I tried with table helper, and without with my own table).

here is the example of view

Code:
$query = $this->db->query("SELECT FROM `news` WHERE `active`='1');

foreach($query as $result);
{
$id = $result->id;
$msg = $result->msg;
$from = $result->from;
// Here goes table html (i don't post)

then the code

echo "<tr>"
echo "<td>$id</td>";
echo "<td>$msg</td>";
echo "<td>$from</td>";

}

// It returns only 1 row in table, but i need all where the `active` is '1'.

I tried with model too, no works. Hope it will be resolved or i will try another PHP MVC Framework.
Reply


Messages In This Thread
Possibly bug or incorrect code? - by cyborg - 07-04-2017, 02:36 PM
RE: Possibly bug or incorrect code? - by Wouter60 - 07-04-2017, 10:42 PM
RE: Possibly bug or incorrect code? - by rtenny - 07-05-2017, 01:15 AM
RE: Possibly bug or incorrect code? - by cyborg - 07-05-2017, 05:44 AM
RE: Possibly bug or incorrect code? - by Wouter60 - 07-05-2017, 10:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB