I have a page that displays all appointments for a day. Some people have two procedures done by the same person and some people have two procedures done by different people.
I need the system to look and see if someone is having two procedures done by the same person and if so, only display their info once. If the someone is having two procedures by different people, both rows should appear.
code is here: two fields to compare are PATNUM and SURGEON - if PATNUM and SURGEON are the same in two columns, only show patient once. If PATNUM is same, but SURGEON is different - show the patient each time.
$nurse_query = "SELECT * FROM patientinfo WHERE SCHDT = '$currentdate' ";
$nurse_query_result = mysql_query($nurse_query);
if (mysql_num_rows($nurse_query_result) > 0)
while ($nurse_row = mysql_fetch_assoc($nurse_query_result))
$patient_id = $nurse_row['ID'];
$PATNUM = $nurse_row['PATNUM'];
$SCHDT = $nurse_row['SCHDT'];
$SCHTM = $nurse_row['SCHTM'];
$SURGEON = $nurse_row['SURGEON'];
echo "$PATNUM - $SURGEON<br />\n";