0

in this below program,when i try to run the action of print, the table 'kiri' doesnt print the data. is there something wrong with my code ?


<body class='landScape'>";
?>
<div class="logo">
<img src="logo.jpg" width="80" height="40">
</div>
<hr>
<?php

include "connect.php";
$secretword = $_POST["secretword"];
?> 

<?php echo "<h3>FAKTUR PAJAK REQUISITION CHECK SHEET</h3>";

$sqlheader = "select a.no_trans, a.dept, a.pic, a.issue_date, a.sales_pool , a.reg_status, a.check_by ,a.dept_mgr,receive_by ,a.checkin_by, a.approve_by,a.status,a.other,a.remark,b.desc2
from material_header a, master_add b where a.dept = b.desc1 and no_trans = '$secretword' limit 1";

$hasilheader = mysql_query($sqlheader);
$s = mysql_fetch_array($hasilheader);

$no_trans = $s['no_trans'];
$dept = $s['dept'];
$pic = $s['pic'];
$issue_date = $s['issue_date'];
$sales_pool = $s['sales_pool'];
$reg_status = $s['reg_status'];
$approve_by = $s['approve_by'];
$check_by = $s['check_by'];
$dept_mgr = $s['dept_mgr'];
$receive_by = $s['receive_by'];
$checkin_by = $s['checkin_by'];
$desc2 = $s['desc2'];
$other = $s['other'];
?>

<?php echo "<table class='kiri'>
    <tr><td>Registration Number </td><td>: $no_trans </td></tr>
    <tr><td>Issue Date </td><td>: $issue_date</td></tr>
    <tr><td>Department/Division </td><td>: $dept </td></tr>
    <tr><td>Sales Pool </td><td>: $sales_pool </td></tr>
    <tr><td>Registration Status </td><td>: $reg_status </td></tr>
</table>"; 

?>

when i run the program, i give the action print and it is in the 'kiri' table. but when i try to give an action to the print the echo doesnt work.

R.Bruning
  • 21
  • 1
  • 2
  • What print-command? Like for printing it out onto paper? If the content is on the page, it should print. Or you need to make your question clearer. – junkfoodjunkie May 09 '17 at 01:47
  • *[Please stop using mysql_* functions](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php)*. [These extensions have been removed in PHP 7](http://php.net/manual/en/migration70.removed-exts-sapis.php). Learn about [prepared statements](https://en.wikipedia.org/wiki/Prepared_statement) for [PDO](http://php.net/manual/en/pdo.prepared-statements.php) and/or [MySQLi](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php), and consider using one of those database-handlers. [It's really pretty easy](http://jayblanchard.net/demystifying_php_pdo.html) – junkfoodjunkie May 09 '17 at 01:47
  • @junkfoodjunkie the print command show the output of the inputted data, doesnt go out to paper. – R.Bruning May 09 '17 at 01:54
  • try to `print_r($s)` before the echo command .. check if the variable does have content. – Demonyowh May 09 '17 at 01:57
  • I know that, but there is no `print` command in the code you provided - hence it's impossible to know what you're talking about. – junkfoodjunkie May 09 '17 at 01:57
  • @junkfoodjunkie he's referring to `echo` i think. the table doesn't print – Demonyowh May 09 '17 at 01:58
  • If so, check the logs. It's that simple. If there is an error in the PHP, it will show in the logs. – junkfoodjunkie May 09 '17 at 01:59
  • Please check if this helps, http://stackoverflow.com/questions/468881/print-div-id-printarea-div-only – manian May 09 '17 at 02:12

0 Answers0