Kova_Llano Posted March 12, 2014 Share Posted March 12, 2014 hello guys, i have this kind of issue where data that i call from database does not appear in the form. there is no syntax error, but it does not appear on the form i create. as follow:- http://prntscr.com/303h3q http://prntscr.com/303hb3 <table width="1001" border="0" align="center" cellpadding="0" cellspacing="0"> <?php include('database.php'); $dataot = mysql_query("SELECT s.nama, s.noic, s.jabatan, s.jawatan, s.gred, s.nostaf, OT.otl_tkh_m FROM staf s, ot_line OT WHERE s.nostaf='NA4451'")or die(mysql_error());{ ?> <tr> <td><p><span id="form2">Saya mengakui bahawa saya telah diarah membuat kerja lebih masa untuk bulan <?php echo $dataot['OT.otl_tkh_m'];?> seperti butir-butir tercatat di bawah dan</span><span> tuntutan ini adalah mengikut peraturan di Lampiran D Pekeliling Perkhidmatan Bil. 1 Tahun 1977</span>. </p></td> </tr> </table> <table width="1001" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> </table> <table width="1001" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="1001" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="133">Nama</td> <td width="348">:<?php echo $dataot['nama'];?></td> <td width="23"> </td> <td width="115">Jawatan</td> <td width="150">:<?php echo $dataot['jawatan'];?></td> <td width="102">Gred Gaji</td> <td colspan="2">:<?php echo $dataot['gred']; ?></td> </tr> <tr> <td>No Kad Pengenalan</td> <td>:<?php echo $dataot['noic']; ?></td> <td> </td> <td>Gaji Pokok</td> <td>:</td> <td>No Kakitangan</td> <td colspan="2">:<?php echo $dataot['nostaf'];?></td> </tr> <tr> <td>Fakulti/Jabatan:</td> <td>:<?php echo $dataot['jabatan'];?></td> <td colspan="6"> </td> </tr> </table></td><?php } ?> </tr> </table> where should it be place? Quote Link to comment Share on other sites More sharing options...
Yohanne Posted March 12, 2014 Share Posted March 12, 2014 try this.. <table width="1001" border="0" align="center" cellpadding="0" cellspacing="0"> <?php include('database.php'); $sql = mysql_query("SELECT s.nama, s.noic, s.jabatan, s.jawatan, s.gred, s.nostaf, OT.otl_tkh_m FROM staf s, ot_line OT WHERE s.nostaf='NA4451'")or die(mysql_error()); if(mysql_num_rows($sql) < 1) { echo "<p>Currently, there are no content in the database to display at the moment.</p>"; } else { while($dataot = mysql_fetch_array($sql)) ?> <tr> <td><p><span id="form2">Saya mengakui bahawa saya telah diarah membuat kerja lebih masa untuk bulan <?php echo $dataot['OT.otl_tkh_m'];?> seperti butir-butir tercatat di bawah dan</span><span> tuntutan ini adalah mengikut peraturan di Lampiran D Pekeliling Perkhidmatan Bil. 1 Tahun 1977</span>. </p></td> </tr> </table> <table width="1001" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> </table> <table width="1001" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="1001" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="133">Nama</td> <td width="348">:<?php echo $dataot['nama'];?></td> <td width="23"> </td> <td width="115">Jawatan</td> <td width="150">:<?php echo $dataot['jawatan'];?></td> <td width="102">Gred Gaji</td> <td colspan="2">:<?php echo $dataot['gred']; ?></td> </tr> <tr> <td>No Kad Pengenalan</td> <td>:<?php echo $dataot['noic']; ?></td> <td> </td> <td>Gaji Pokok</td> <td>:</td> <td>No Kakitangan</td> <td colspan="2">:<?php echo $dataot['nostaf'];?></td> </tr> <tr> <td>Fakulti/Jabatan:</td> <td>:<?php echo $dataot['jabatan'];?></td> <td colspan="6"> </td> </tr> </table></td><?php } ?> </tr> </table> Quote Link to comment Share on other sites More sharing options...
Kova_Llano Posted March 12, 2014 Author Share Posted March 12, 2014 thanks for reply. but it still the same. does not shows content. below is the file content. since i compile in straight from the server. so, i did not see such php code on the form. that doesnt matter, the form fail the information from database. form1_final_dead.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.