'; // Iterate through the rows, printing XML nodes for each while ($row = @mysql_fetch_assoc($result)) { $query = "SELECT category FROM `category` AS t1, `cat-loc` AS t2 WHERE t1.id = t2.cat_id AND t2.loc_id = $row[id] LIMIT 1"; $result2 = mysql_query($query); mysql_num_rows($result2); $type = ""; if($result2) { $type = mysql_fetch_assoc($result2); $type = $type['category']; } // ADD TO XML DOCUMENT NODE list($group,$name) = explode(".",$row['name']); $url = "$PubDirUrl/$group/$row[image]"; $xmlfile .= '