$query = "Select * FROM data WHERE sub_id=$sub_id";
$data_set = mysql_query($query);
$array = array();
while ($data = mysql_fetch_assoc($data_set)) {
$array[] = $data['id'];
echo ' '.$data['name'].' ';
}
print_r ($array);
Let's say I have three rows - it will print three 'name's but then the print_r will only show the last id - so if the last 'id' is 167 - print_r returns only: Array ( [0] => 167 ).
It looks like the array here is not cumulative - is that the right word? It's getting overwritten every time through.
So how to construct the array so I have all three ids?
Thanks again
J