I have the following code in my PHP program:
$query = "SELECT * FROM board_members";
$result = mysql_query($query) or die(mysql_error());
$data = array(); // create a variable to hold the information
while (($row = mysql_fetch_array($result, MYSQL_ASSOC)) !== false){
$data[] = $row; // add the row in to the results (data) array
}
print_r($data); // print result
This give me the following corrrect data for the table:
Array ( [0] => Array ( [FirstName] => Alona [LastName] => Burnett [Amount] => 1000.00 ) [1] => Array ( [FirstName] => Anna Marie [LastName] => Hartman [Amount] => 1200.00 ) [2] => Array ( [FirstName] => Anne [LastName] => Ferguson [Amount] => 500.00 ) [3] => Array ( [FirstName] => Bobbie [LastName] => McLaughlin [Amount] => 900.00 )
How can I echo for example the third person's FirstName, then LastName, then Amount?
I would like to use something like echo $data[FirstName][2] to get the first name from the 3rd row.