[FX.php List] Comparing Value from Portal Field to Field Value

Kim Hawksworth Kim.Hawksworth at osumc.edu
Tue Sep 19 11:51:20 MDT 2006


This one has got me stumped.

I have two related tables.  One contains formula records for intravenous
nutrition and the other contains comments about formula changes. There¹s the
potential to have multiple related records in each table, but not
necessarily an exact match.  In other words, there could be 6 records in the
formula table and only 2 related records in the comments table.  What I¹m
trying to do is compare the creation date field from the records in formula
table  with the creation date field from the records in the comments table.
If they match, display an asterisks on row of the corresponding formula in
the results page so the user knows there¹s a comment associated with that
record.  I can get this to work with the first record in the comments table
but not any others.  Two things I¹ve tried without success is a second
instance on the formula results page that queries for related records in the
comments table and a portal on the layout of formulas table.  The portal
displays values from each related record just fine, but I can¹t get it to
compare more than the first record.  Here¹s a snippet of the code I¹ve tried
using the portal:

$tpnData_search = new FX($serverIP, $webCompanionPort, $dataSourceType);
$tpnData_search ->SetDBData("nss.fp7", "tpn", $GroupSize);
$tpnData_search -> AddDBParam("visit_num", "$visit_num");
$tpnData_search -> AddSortParam("date_rev", "descend");
$tpnData_search -> AddSortParam("time", "descend");
$tpnData_search -> FMSkipRecords($skipSize);
admTpn_results = $tpnData_search -> FMFind();

<tr>

foreach ($admTpn_results['data'] as $key => $returnedData) {

if ($returnedData['date'][0] == $returnedData['tpn_comments::date'][0]) {

?>
<td align="center"><a style="text-decoration: none;"
href="javascript:popUpWin2('/nss/tpnComments/tpnCommentResultsIndv.php?visit
_num=<?php echo $recordData['visit_num'][0]; ?>&date=<?php echo
$commentData['date'][0]; ?>')">&nbsp;*&nbsp;</a>
</td>
<?php
} else { 
?>
<td>&nbsp;</td>

<?php
} 
   }    
?>
</tr>

Any thoughts or suggestions on how to compare more than one record will be
greatly appreciated.

Thanks for your time.

--Kim 

-- 
Kim David Hawksworth, R.Ph., Web Manager
The OSUMC Dept. of Pharmacy
410 W. 10Th Ave, Room 368 Doan
Ph# (614) 293-3765
Pager# (614) 730-8143
Email: kim.hawksworth at osumc.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060919/179fd99c/attachment.html


More information about the FX.php_List mailing list