I have created a query which I am using to display reports. The query gets data from a few different tables which is fine, although I cannot figure out how to echo more than one matching value within a table. For example the table vtiger_addisa has more than one newcurrentamount which I need displayed.
$sql = $adb->query("SELECT *
FROM vtiger_isa, vtiger_addisa, vtiger_contactdetails
WHERE vtiger_isa.relatedclient = vtiger_addisa.addrelatedclient
AND vtiger_addisa.addrelatedclient = vtiger_contactdetails.contactid
AND vtiger_isa.relatedclient = $relatedclient
AND vtiger_isa.policynumber = $policynumber");
//Uncomment lines below for testing sql
//echo $sql;
//exit;
while ($sql->fetchInto($row)) {
// Assuming DB's default fetchmode is DB_FETCHMODE_ORDERED
echo $row['firstname'] . "
";
echo $row['lastname'] . "
";
echo $row['policynumber'] . "
";
echo $row['newcurrentamount'] . "
";
echo $row['newcurrentamount'] . "
";
echo $row['currentamount'] . "
";
exit;
}