Advertisement
Guest User

Untitled

a guest
May 12th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.19 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>Home</title>
  4.    
  5.     <!-- Internal Style Sheet -->
  6.     <style type="text/css">
  7.         #update
  8.         {
  9.         margin-left: auto;
  10.         margin-right: auto;
  11.         border-collapse:collapse;
  12.         }
  13.        
  14.         #update td, #update th
  15.         {
  16.         font-size:1em;
  17.         border:1px solid #104667;
  18.         padding:3px 7px 2px 7px;
  19.         }
  20.        
  21.         #update th
  22.         {
  23.         font-size:1.1em;
  24.         text-align:left;
  25.         padding-top:5px;
  26.         padding-bottom:4px;
  27.         background-color:#104667;
  28.         color:#ffffff;
  29.         }
  30.     </style>
  31.    
  32. </head>
  33.  
  34. <body>
  35.  
  36.     <?php
  37.    
  38.     // mysql Variables //
  39.         $mysql_localhost = "local_host";
  40.         $mysql_username = "db_username";
  41.         $mysql_database = "db_name";
  42.         $mysql_password = "db_password";
  43.    
  44.     // Connects to mysql datatbase //
  45.         mysql_connect("$mysql_localhost", "$mysql_username", "$mysql_password") or die(mysql_error());
  46.         mysql_select_db("$mysql_database") or die(mysql_error());
  47.     }
  48.    
  49.     // Selects all data from table
  50.     $qry = "SELECT * FROM add_update";
  51.     $res = mysql_query($qry);
  52.     $member = mysql_fetch_assoc($res);
  53.    
  54.     ?>
  55.  
  56.     <table id="update">
  57.         <th>
  58.             <?php echo $member['title']; ?>
  59.         </th>
  60.                
  61.         <tr>
  62.             <td>
  63.                 <?php echo $member['content']; ?>
  64.             </td>
  65.         </tr>
  66.     </table>
  67.    
  68. </body>
  69.  
  70. <html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement