<?php// Do database queryprint "products = {"while($record = getNextRecord_{ $software = record['name'] $buildID = $record['id'] $version = $record['version'] $lastSoftware = ''; if($lastSoftware != '') { // Comma which separates this record from last // But only if there was a previous record print ", \n"; } if(lastSoftware != software) { if($lastSoftware = '') { // There was a previous software array // So close that array. print "],\n" } print $record['productName'] + ": [" } print "{buildID:" + $buildID + ", version:'" + $version + "'}"}print "] }"; // Close the last product array, and the enclosing hash?>