Advertisement
Guest User

Untitled

a guest
Jul 7th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang = "en-US">
  3. <head>
  4. <meta charset = "UTF-8">
  5. <title>contact.php</title>
  6. <style type = "text/css">
  7. table, th, td {border: 1px solid black};
  8. </style>
  9. </head>
  10. <body>
  11.  
  12. <?php
  13.  
  14. $host="localhost"; // Host name
  15. $username=" "; // Mysql username
  16. $password=" "; // Mysql password
  17. $db_name="aspectinfo"; // Database name
  18. $tbl_name="Jaipur DSRO$"; // Table name
  19.  
  20. // Connect to server and select databse.
  21. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  22. mysql_select_db("$db_name")or die("cannot select DB");
  23. $sql="SELECT * FROM $tbl_name ORDER BY id DESC";
  24. // ORDER BY id DESC is order result by descending
  25. }
  26. $result=mysql_query($sql);
  27.  
  28. ?>
  29.  
  30. <html>
  31.  
  32. <head>
  33.  
  34. <script type="text/javascript" charset="utf-8" src="jquery.js">
  35. </script>
  36. </head>
  37.  
  38. <table id="forum" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
  39.  
  40. <thead>
  41.  
  42. <tr>
  43. <th width="6%" align="center" bgcolor="#E6E6E6"><strong>Sr#No</strong></td>
  44. <th width="43%" align="center" bgcolor="#E6E6E6"><strong>Asser Tag</strong></td>
  45. <th width="10%" align="center" bgcolor="#E6E6E6"><strong>Asset Description</strong></td>
  46. <th width="15%" align="center" bgcolor="#E6E6E6"><strong>emp no</strong></td>
  47. <th width="13%" align="center" bgcolor="#E6E6E6"><strong>emp name</strong></td>
  48. <th width="13%" align="center" bgcolor="#E6E6E6<strong>desktop</strong></td>
  49.  
  50. </tr>
  51.  
  52. </thead>
  53.  
  54. <?php
  55. // Start looping table row
  56. while($rows=mysql_fetch_array($result)){
  57. ?>
  58. <tbody>
  59.  
  60. <tr>
  61. <td bgcolor="#FFFFFF"><? echo $rows['Sr#No']; ?></td>
  62. <td bgcolor="#FFFFFF"><? echo $rows['Asser Tag']; ?> <? echo $rows['topic']; ?><BR></td>
  63. <td align="center" bgcolor="#FFFFFF"><? echo $rows['Asset Description']; ?></td>
  64. <td align="center" bgcolor="#FFFFFF"><? echo $rows['emp no']; ?></td>
  65. <td align="center" bgcolor="#FFFFFF"><? echo $rows['emp name']; ?></td>
  66. <td align="center" bgcolor="#FFFFFF"><? echo $rows['desktop']; ?></td>
  67. </tr>
  68.  
  69. </tbody>
  70.  
  71.  
  72. <?php
  73.  
  74. // Exit looping and close connection
  75. }
  76.  
  77. mysql_close();
  78.  
  79. ?>
  80.  
  81. <tfoot>
  82. <tr>
  83. <td colspan="6" align="right" bgcolor="#E6E6E6"><strong>Create NewTopic,</td>
  84. </tr></strong>
  85. </tfoot>
  86. </table>
  87.  
  88. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement