Is there a faster (better) way to do the following:
if ($result) {
for ($cluster=1;$cluster<200;$cluster++) {
for($galaxy=1;$galaxy<26;$galaxy++) {
$sql="insert into galaxy select avg(cluster) as gcluster,sum(size) as gsize,sum(score) as gscore,avg(galaxy) as ggalax
y from universe where cluster='$cluster' and galaxy='$galaxy'";
$result=db_query($sql);
if ($result) {
for ($cluster=1;$cluster<200;$cluster++) {
for($galaxy=1;$galaxy<26;$galaxy++) {
$sql="insert into galaxy select avg(cluster) as gcluster,sum(size) as gsize,sum(score) as gscore,avg(galaxy) as ggalax
y from universe where cluster='$cluster' and galaxy='$galaxy'";
$result=db_query($sql);