0
我創建一個PHP腳本來生成基於存儲在SQL數據報表時不顯示,查詢是在這裏:第一個結果使用while循環
$sql = $adb->query("SELECT firstname, lastname, policynumber, isatype, isaname, startdate, unitvalue, numberofunits, currentamount, date, newunitvalue, newnumberofunits, newcurrentamount
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 = $clientid
AND vtiger_isa.policynumber = $polnum
AND vtiger_addisa.addrelatedclient = $clientid
AND vtiger_addisa.newpolicynumber = $polnum
ORDER BY date ASC"
);
因爲我已經通過測試,這將執行罰款print_r($sql);
和我想要的結果在那裏。儘管當我循環播放結果時,他們沒有顯示出來。我已經測試過不同的clientid,第一個結果似乎錯過了。
<b> New Figures:</b>
<table style="width:100%">
<tr>
<th>Date</th>
<th>Unit Value (P)</th>
<th>Number of Units</th>
<th>Total Value (£)</th>
</tr>
<?php
while ($sql->fetchInto($row)) {
?>
<tr>
<td><?php echo $row['date'];?></td>
<td><?php echo $row['newunitvalue'];?></td>
<td><?php echo $row['newnumberofunits'];?></td>
<td><?php echo $row['newcurrentamount'];?></td>
</tr>
<?php
}?>
</table>
</body>
</html>
您是否嘗試過執行phpMyAdmin SQL部分中的代碼?或者你可以嘗試嗎? –