I'm looking to add a __ in the Array variable for each of the rows in the database.
In my testTable I currently have 2 rows though when running this code only one is 'pushed' to the array.
$result = mysql_query("SELECT * FROM testTable ORDER BY dateAdded DESC");
while($row = mysql_fetch_array($result)) {
$Array = array();
array_push($Array, array('id' => $row['id'], 'title' => $row['title'], 'desc' => $row['desc'], 'image' => $row['image'], 'dateAdded' => $row['dateAdded']);
}
print_r($Array);
The output:
Array ( [0] => Array ( [id] => 2 [title] => test test test [desc] => text text text [image] => http://domain.com/sampleImg.png [dateAdded] => 2012-06-13 15:58:43 ) )
It worked when I tried to just echo the title for example... like this:
while($row = mysql_fetch_array($result)) {
echo $row['title'];
}