Array & loops
| From: | Robin Sanchez | Date: | Thu, 06 Mar 2003 17:12:03 +0000 |
| Subject: | Array & loops | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26127@lists.php.net to get a copy of this message | ||
I am creating a results page for completed and uncompleted procedures. I am
repeating a lot of the code and wonder if there is an easier way to do this.
$neh="select * from pro_list, complete_pro where pro_list.pro_name
='Neurological Exam/History'
and complete_pro.proid=pro_list.proid
and complete_pro.sysid='$sysid'
and complete_pro.transid='$transid'";
$resneh=safe_query($neh);
while ($rown=mysql_fetch_array($resneh)){
$compl_date1=$rown['compl_date'];
}
echo "<p>1. Neurological Exam and History $compl_date1";
$neh="select * from pro_list, complete_pro where pro_list.pro_name ='Ankle
Arm BP Measurement'
and complete_pro.proid=pro_list.proid
and complete_pro.sysid='$sysid'
and complete_pro.transid='$transid'";
$resneh=safe_query($neh);
while ($rown=mysql_fetch_array($resneh)){
$compl_date2=$rown['compl_date'];
}
echo "<P>2. Ankle/Arm BP Measurement $compl_date2"; and so on and so on...
It seems that I could use a 'for' loop in the searches, but how do I
populate the result fields (some of which will be empty) with the
appropriate tests.
Any thoughts.
Ozzie