Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang = "en-US">
- <head>
- <meta charset = "UTF-8">
- <title>contact.php</title>
- <style type = "text/css">
- table, th, td {border: 1px solid black};
- </style>
- </head>
- <body>
- <?php
- $host="localhost"; // Host name
- $username=" "; // Mysql username
- $password=" "; // Mysql password
- $db_name="aspectinfo"; // Database name
- $tbl_name="Jaipur DSRO$"; // Table name
- // Connect to server and select databse.
- mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $sql="SELECT * FROM $tbl_name ORDER BY id DESC";
- // ORDER BY id DESC is order result by descending
- }
- $result=mysql_query($sql);
- ?>
- <html>
- <head>
- <script type="text/javascript" charset="utf-8" src="jquery.js">
- </script>
- </head>
- <table id="forum" width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
- <thead>
- <tr>
- <th width="6%" align="center" bgcolor="#E6E6E6"><strong>Sr#No</strong></td>
- <th width="43%" align="center" bgcolor="#E6E6E6"><strong>Asser Tag</strong></td>
- <th width="10%" align="center" bgcolor="#E6E6E6"><strong>Asset Description</strong></td>
- <th width="15%" align="center" bgcolor="#E6E6E6"><strong>emp no</strong></td>
- <th width="13%" align="center" bgcolor="#E6E6E6"><strong>emp name</strong></td>
- <th width="13%" align="center" bgcolor="#E6E6E6<strong>desktop</strong></td>
- </tr>
- </thead>
- <?php
- // Start looping table row
- while($rows=mysql_fetch_array($result)){
- ?>
- <tbody>
- <tr>
- <td bgcolor="#FFFFFF"><? echo $rows['Sr#No']; ?></td>
- <td bgcolor="#FFFFFF"><? echo $rows['Asser Tag']; ?> <? echo $rows['topic']; ?><BR></td>
- <td align="center" bgcolor="#FFFFFF"><? echo $rows['Asset Description']; ?></td>
- <td align="center" bgcolor="#FFFFFF"><? echo $rows['emp no']; ?></td>
- <td align="center" bgcolor="#FFFFFF"><? echo $rows['emp name']; ?></td>
- <td align="center" bgcolor="#FFFFFF"><? echo $rows['desktop']; ?></td>
- </tr>
- </tbody>
- <?php
- // Exit looping and close connection
- }
- mysql_close();
- ?>
- <tfoot>
- <tr>
- <td colspan="6" align="right" bgcolor="#E6E6E6"><strong>Create NewTopic,</td>
- </tr></strong>
- </tfoot>
- </table>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement