echo "
<tr>
<td colspan='4' ><b> Total Candidate Consultant $temp </b></td>
<td align='center'><b> $jmlcandidate </b></td>
<td align='center'><b> $jumnerly </b></td>
<td align='center'><b>".number_format($jumnerly / $jmlcandidate * 100,2)." %</b></td>
<td align='center'><b> $jumwc </b></td>
<td align='center'><b>".number_format($jumwc / $jmlcandidate * 100,2 )." %</b></td>
<td align='center'><b> $jumspot </b></td>
<td align='center'><b>".number_format($jumspot / $jmlcandidate * 100,2 )." %</b></td>
<td align='center'><b> $jumnot </b></td>
<td align='center'><b>".number_format($jumnot / $jmlcandidate * 100,2 )." %</b></td>
<td align='center'><b> $jumun </b></td>
<td align='center'><b>".number_format($jumun / $jmlcandidate * 100,2 )." %</b></td>
</tr>
";
Nah ketika program di jalankan munculah si warning tersebut setelah cari-cari di programmer google akhirnya ketemu, dan sangan simpel sekali.
Warning tersebut muncul ketika kita membagi suatu bilangan dengan nilai 0, pada kasus saya di atas variabel $jmlcandidate = 0 makanya muncul warning tersebut solusinya kita pakai if saja sehingga menjadi
if ($jmlcandidate > 0) {
echo "
<tr>
<td colspan='4' ><b> Total Candidate Consultant $temp </b></td>
<td align='center'><b> $jmlcandidate </b></td>
<td align='center'><b> $jumnerly </b></td>
<td align='center'><b>".number_format($jumnerly / $jmlcandidate * 100,2)." %</b></td>
<td align='center'><b> $jumwc </b></td>
<td align='center'><b>".number_format($jumwc / $jmlcandidate * 100,2 )." %</b></td>
<td align='center'><b> $jumspot </b></td>
<td align='center'><b>".number_format($jumspot / $jmlcandidate * 100,2 )." %</b></td>
<td align='center'><b> $jumnot </b></td>
<td align='center'><b>".number_format($jumnot / $jmlcandidate * 100,2 )." %</b></td>
<td align='center'><b> $jumun </b></td>
<td align='center'><b>".number_format($jumun / $jmlcandidate * 100,2 )." %</b></td>
</tr>
";
}
dan masalah pun teratasi
sekian...
A Short Description about youself
Any feedback, questions or ideas are always welcome. In case you are posting Code ,then first escape it using Postify and then paste it in the comments
0 comments: