$sql = "SELECT s.school_id, s.name, s.country, st.name as type, s.review FROM schools s, school_types st " .
"WHERE s.school_type_id = st.school_type_id ORDER BY s.school_type_id, s.country, s.name";
$iCnt = $DBCONN->Query($sql);
$oldType = "";
$oldCountry = "";
for ($ii = 0; $ii < $iCnt; $ii++)
{
$rgResult = $DBCONN->GetNextRow();
if ($oldType != $rgResult['type']) // we changed types
{
if ($oldType != "") // it is not the first one
{
$oldCountry = ""; // reset to cause it to display at the start of the new type
?>
} $oldType = $rgResult['type']; ?> = $rgResult['type'] ?> } if ($rgResult['country'] != $oldCountry) { if ($oldCountr != "") { ?> } ?> = $rgResult['country'] ?>
|
|