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

(This post was last modified: 07-04-2017, 10:23 PM by usmanahmed.)

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>";
}
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 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 Wouter60 - 07-05-2017, 10:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB