Jump to content
asmiera201190

Papar Data Menggunakan 2 Tarikh

Recommended Posts

  1. <?php
  2. echo "<table border='1' style='border-collapse: collapse;border-color: silver;'>";
  3.  
  4. echo "<td width='100' align='center'>date in</td><td width='100' align='center'>date out</td>
  5. <td width='100' align='center'>model</td>
  6. ";
  7.  
  8. echo "</tr>";
  9.  
  10. include("proses/dbcon.php");
  11.  
  12. $date_in = $_POST['date_in'];
  13. $date_out = $_POST['date_out'];
  14.  
  15. if(isset($submit))
  16. {
  17. $sql = "select * from inventory where createdate >= '$date_in' and createdate <= '$date_out' ";
  18. }
  19. $result= mysql_query($sql);
  20.  
  21. while($row=mysql_fetch_array($result))
  22. {
  23.  
  24. echo "<tr>";
  25. echo "<td align='center' width='200'>" . $row['date_in'] . "</td>";
  26. echo "<td align='center' width='200'>" . $row['date_out'] . "</td>";
  27. echo "<td align='center' width='200'>" . $row['model'] . "</td>";
  28. echo "</tr>";
  29. }
  30. echo "</table>";
  31.  
  32. ?>


nie untuk input yang akan display 

 

<form method="post" action="view.php"> <label>From Time : </label><input type="date" name="date_in" /><br/><br/> <label>To Time : </label><input type="date" name="date_out" /><br/><br/> <input type="submit" name="submit" value="Submit" /> </form>

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...