Jump to content

Data Does Not Display


Kova_Llano

Recommended Posts

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. :sweat:

 

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?

 

Link to comment
https://forums.phpfreaks.com/topic/286910-data-does-not-display/
Share on other sites

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>

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.