Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14115

Possibly bug or incorrect code?

$
0
0
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.

Viewing all articles
Browse latest Browse all 14115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>