I'm using ADOdb to query a MSSQL db. Once the query runs and the results are in a ADOdbRecordSet I would like to change some data in it before displaying with rsthtml(), (haven't worked on beautifying the output yet .😃).
Here's the code to do this so far but it only changes & displays the first row when passing through rs2html(). Really all I'm doing is wanting to modify element [0] in the fields[] array so that if it is 1, 2, or 3...it becomes LOW, MEDIUM, or HIGH respectively.
<?php
$rs = $dbconn->Execute($sSQL);
for ($i = 0, $max = $rs->RowCount(); $i < $max; $i++) {
$rs->Move($i);
switch($rs->fields[0]) {
case 3:
$rs->fields[0] = "HIGH";
break;
case 2:
$rs->fields[0] = "MEDIUM";
break;
case 1:
$rs->fields[0] = "LOW";
break;
}
}
rsthtml($rs, ~args~, ~args~);
?>
Any assistance would be appreciated.
-John