I am using this query to return records:
$sql = "SELECT dat1, dat2, dat3 FROM data WHERE data_type = '1' ORDER BY dat1 ASC;";
then i look through the results like so:
while( odbc_fetch_row($result) ){
$dat1 = odbc_result($result,1);
$dat2 = odbc_result($result,2);
$dat3 = date('m.d.y', strtotime(odbc_result($result,3)));
print $dat1 . " ";
print $dat2 . " ";
print $dat3 . " ";
print "<br />";
}
dat1 is a category that I want to use as a meaningful organizer for the results. I want the loop to print a message when the dat1 result changes. For example, dat1 might return AAAAAA and have specific values for dat2 and dat3 for each row, then it may be BBBBB and have different values for dat2 and dat3 for each row. I want to print a result saying now its time for BBBBB .... and then resume the loop. Also, there is not a unique key that I can use that identifies A as 1 and B as 2 etc.
Thanks.