I am looking to fetch 5 Rows from a database and then each row into an array, but I am not sure how to do it, so I can access all 5 rows from the array variable.
Add a limit value to your sql statement to get just a specific count from your items. Something like this: SELECT * FROM `your_table` LIMIT 0, 5 This sql statement selects the first 5 items from your table. Then it's up to the programming language you use to get the items from your database table. In PHP you can use mysql_query() and mysql_fetch_array() to get the items and iterate through: $query = "SELECT * FROM 'your_table' LIMIT 0, 5"; $result = mysql_query($query) or die('Query: '.$query.'<br>Failed: '.mysql_error()); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { /* ... */ } Hope it helps.