Thanks for reply weedpacket.
Here is the loop I came up with with i++:
<script>
var dsi = new Array(
<?php
$resultTwo = mysql_query($sql);
while($rowTwo = mysql_fetch_array($resultTwo)) {
$tracks = $rowTwo['m_nameTwo'];
#$first == "";
$incJS==2; $incJS<=$total_pages; $incJS++;
echo ",\"" . $incJS . "\"";
}
?>
);
for(i=0;i<dsi.length;i++) {
if(dsi[i] != id) $("#remix_player_"+dsi[i]).html(players[dsi[i]][1]);
}
$("#remix_player_"+id).html(players[id][0]);
}
</script>
$total_pages - is a var that COUNT() all tracks by a user.
Here is the output it prints:
<script>
var dsi = new Array(
,"1","2","3","4","5","6","7","8","9","10");
for(i=0;i<dsi.length;i++) {
if(dsi[i] != id) $("#remix_player_"+dsi[i]).html(players[dsi[i]][1]);
}
$("#remix_player_"+id).html(players[id][0]);
}
</script>
If I switch around commas and put it after incJS it will give me "1", "2", and end with a comma.
As for array, I was thinking about putting each record from db into it and then outputting it, but problem with comma still exists - as I imagine.