Read Rows from Table

This page has a PHP script that reads all rows out of a table in the database. We store the rows in an array and then loop through that array (using a foreach loop) and print out each row in the XHTML.

The query that we ran on the database to produce these results was:

SELECT * FROM abloomberg_animals WHERE 1 ORDER BY created DESC
id name description image created
413 2012-05-21 00:50:44

Debugging

Here is the raw output of what's inside of the $animals array. Notice, it's a multi-dimensional array (a series of associative arrays within a simple array).

Array
(
    [0] => Array
        (
            [0] => 413
            [id] => 413
            [1] => 
            [name] => 
            [2] => 
            [description] => 
            [3] => 
            [image_url] => 
            [4] => 2012-05-21 00:50:44
            [created] => 2012-05-21 00:50:44
        )

)