codice:
while( $rows = mysql_fetch_array($getpic))
{

$id_array[] = $rows['id'];

echo "
 rows[id]
";

}
gli id saranno nell'array $id_array;