The only mysql_fetch_*() is in the loop. Here's what preceeds the loop and the loop again. The variables are working, I can echo them out during the loop and the correct data displays. The first row just doesn't get written to the database from the INSERT INTO statement.
//Get active top 10
$query="SELECT B.name, A.title, S.song, S.id, R.rating_sum/R.rating_count as 'avgrating'
FROM
jos_musicboxalbum A
LEFT JOIN jos_musicboxsong S ON A.id = S.albumid
LEFT JOIN jos_musicbox X ON X.idalbum = A.id
LEFT JOIN jos_musicboxsinger B ON B.id = X.idauth
LEFT JOIN jos_musicbox_rating R ON R.content_id = A.id
ORDER BY avgrating DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
//truncate working table
$truncate=mysql_query("TRUNCATE
oms_topten_working");
echo "working table truncated";
//Loop inserts Top 10 to working table
if ($num>10) {
$to=10;
}else{
$to=$num;
}
for ($i = 0; $i < $to; $i++) {
$row = mysql_fetch_assoc($result);
extract($row);
$pos=$i+1;
$loop="INSERT INTO
oms_topten_working
(pos, prevpos, woc, band, album, song, songid, rating)
Values
('$pos', 0, 0, '$name', '$title', '$song', '$id', '$avgrating')";
$update=mysql_query($loop);
}