indexed array from recordset
I am trying to create a simple, indexed array from a recordset, but cannot seem to get it in the correct format.
I am retrieving a single field, EMail.
If I was to do this manually, it would look like
$emailarray = array('name1@address.com', 'name2@address.com','name3@address.com');
and if i did a print_r($emailarray);
it would look like
Array ( [0] => name1@address.com [1] => name2@address.com [2] => name3@address.com )
which is exactly what i want
when i try and do the same using a recordset, i cannot get the same result.
If I try
$emailarray = array();
do {
$emailarray[] = $row_rsmembersreplied;
} while ($row_rsmembersreplied = mysql_fetch_row($rsmembersreplied));
print_r($emailarray);
i get
Array ( [0] => Array ( [email] => name1@address.com ) [1] => Array ( [0] => name2@address.com ) [2] => Array ( [0] => name3@address.com ) )
If I omit the [] within the do..while loop. i get the correct format, but only one row returned