Форуми / Cotonti / Support / Help with outputting select statement results!

Twiebie
#39087 26.01.2014 15:08

On line 2 you've put the first row in $row and then you started looping through the result.

Use fetchAll() like so:

$sql = $db->query("SELECT * FROM cot_test ORDER BY test_title ASC");

foreach ($sql->fetchAll() as $row)
{
    echo $row['test_title'];
    echo "<br>";
}