ok so after some testing i'm still really confused...
here are some results:
#1
$i=0;
while($row_targets = mysql_fetch_array($rs_targets))
{
$chid = $row_targets['nid'];
$targets['id'][] = $chid;
echo "bah humbug $i {$targets['id'][$i]} <br />";
$i++;
}
returns:
bah humbug 0 1287-0308954
bah humbug 1 1287-0308955
bah humbug 2 1287-0308957
bah humbug 3 1287-0308958
bah humbug 4 1287-0308959
bah humbug 5 1287-0308960
(missing first record!)
#2
$i=0;
while($i < mysql_num_rows($rs_targets)){
$chid = $row_targets['nid'];
$targets['id'][] = $chid;
$i++;
}
foreach($targets['id'] as $key => $value){
echo "bah humbug $key $value <br />";
}
returns:
bah humbug 0 1287-0308952
bah humbug 1 1287-0308952
bah humbug 2 1287-0308952
bah humbug 3 1287-0308952
bah humbug 4 1287-0308952
bah humbug 5 1287-0308952
at least its getting the number of records right ($i).....and that $value it keeps repeating is actually the first record in the mysql table.....so in order the records should be:
bah humbug 0 1287-0308952
bah humbug 1 1287-0308954
bah humbug 2 1287-0308955
bah humbug 3 1287-0308957
bah humbug 4 1287-0308958
bah humbug 5 1287-0308959
#3 (original code)
while($row_targets = mysql_fetch_array($rs_targets))
{
$chid = $row_targets['nid'];
$targets['id'][] = $chid;
}
foreach($targets['id'] as $key => $value){
echo "bah humbug $key $value <br />";
}
returns:
bah humbug 0 1287-0308954
bah humbug 1 1287-0308955
bah humbug 2 1287-0308957
bah humbug 3 1287-0308958
bah humbug 4 1287-0308959
bah humbug 5 1287-0308960
(still missing first record)
any ideas much appreciated, this is fun =D