remove the where clause form the recordset and find another way to set the where cluas in the loop
at line 169, change the query to:
$query_detail2productsaudio = "SELECT * FROM productsaudio ORDER BY productname";
then at line 341, change the code that is dynamic changing the where clause:
$nested_query_detail2productsaudio = str_replace("123456789", $row_master1album['id'], $query_detail2productsaudio);
to:
$query_detail2productsaudio = "SELECT * FROM productsaudio WHERE aid=123456789 ORDER BY productname";
$nested_query_detail2productsaudio = str_replace("123456789", $row_master1album['id'], $query_detail2productsaudio);