I'm creating a webpage that pulls information from MsSQL server. My problem is where there is a section with few check boxes. The checkboxes are to indicate where the downpayments are from for a downpayment of house. If the borrower used money from "Savings", "Checking" and "Stock" those checkboxes should be checked. In my case it is only checking whatever is on the first row of the SQL search list. So if the list has "Saving" on the first row, only the "Saving" checkbox will be checked not the rest on the list. I tried using loop to (while($r->EOF)) the end of list, but then it picks whatever is on the end of the list. Here is what I am using to pull data from the SQL server. Thank you in advance for your help. Really appreciate it!
**Code Begins******
function __construct($ldid, $lrid)
$this->ldid = $_ldid;
$this->lrid = $_lrid;
SELECT * FROM Tabel_name where loan_id = 885775
$v = array($ldid, $lrid);
$r = $db->Execute($q, $v);
$this->downpaymenttype = $r->fields;
**End of code*******
*HTML Code
<input type="checkbox" name="DPS1[]" id="DPS1-{$key}" {if $loan->downpaymenttype.downpaymentsource == "Gift"} checked {/if}/>
*End of HTML Code**