Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
displaying items from a database in a loop
  • Hello, I would like to display the item in each row in a table.
    Know why it does not work?
    $find_contact = DB::query("SELECT * FROM contact ORDER BY name DESC"); while($contact=mysql_fetch_array($find_contact))
    {
    echo '<tr>';
    echo "<td>".$contact."</td>";
    echo "<td>".$contact."</td>";
    echo "<td>".$contact."</td>";
    echo "<td>".$contact."</td>";
    echo Form::open();
    echo "<td>". Form::button('delete')."</td>"; // like "X" for delete
    echo Form::close();
    echo '</tr>';
    }
    Warning! ErrorException [ Warning ]: mysql_fetch_array() expects parameter 1 to be resource, object given
    thank you very much
  • * moved to general, this is not an ORM question * What do you think DB:query() returns that you could use in mysql_fetch_array()? Start by checking the docs, or dumping $find_contact...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion