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
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>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.