Possibly bug or incorrect code? |
Remove the semicolon from "foreach($query as $result);" and try. Also, you forgot to add ending double quote in the query.
$query = $this->db->query("SELECT FROM `news` WHERE `active`=1"); foreach($query as $result) { echo "<tr>"; echo "<td>$result->id</td>"; echo "<td>$result->msg</td>"; echo "<td>$result->from</td>"; echo "</tr>"; } |
Messages In This Thread |
Possibly bug or incorrect code? - by cyborg - 07-04-2017, 02:36 PM
RE: Possibly bug or incorrect code? - by usmanahmed - 07-04-2017, 10:06 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 John_Betong - 07-05-2017, 06:54 PM
RE: Possibly bug or incorrect code? - by meSmashsta - 07-05-2017, 05:53 PM
RE: Possibly bug or incorrect code? - by Wouter60 - 07-05-2017, 10:34 PM
|