daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE>
  2.  
  3. <?php
  4. $servername = "localhost";
  5. $username = "remote";
  6. $password = "whats-hot";
  7. $dbname = "whatshot";
  8.  
  9. // Create connection
  10. $conn = new mysqli($servername, $username, $password, $dbname);
  11. // Check connection
  12. if ($conn->connect_error) {
  13.     die("Connection failed: " . $conn->connect_error);
  14. }
  15. ?>
  16.  
  17. <html lang="en">
  18.  
  19.     <head>
  20.     <title> WHAT'S HOT - TWITTER </title>
  21.    
  22.    
  23.     <link rel="stylesheet" type="text/css" href="WebsiteCSS.css"/>
  24.    
  25.  
  26.     </head>
  27.    
  28.    
  29.     <body>                     
  30.        
  31.         <div class="navigation">           
  32.            
  33.             <ul class="navmenu">
  34.             <li> <a href="index.html"> Home </a> </li>
  35.             <li> <a href="###"> Contact </a> </li>
  36.             </ul>
  37.            
  38.         </div>     
  39.        
  40.        
  41.         <div class="banner">
  42.             <img class="banner-image" src="Images/banner3.png">
  43.         </div>     
  44.        
  45. <?php
  46. $sql = "SELECT * FROM twitter LIMIT 5";
  47. $result = $conn->query($sql);
  48.  
  49. if ($result->num_rows > 0) {
  50.     // output data of each row
  51.     while($row = $result->fetch_assoc()) {
  52.         echo "<tr>";
  53.         echo "<td>" . $row["id"] . " " . $row["name"] . " with " . $row["tweets"] . " tweets!<br>" . "</td>";
  54.         echo "</tr>";
  55.     }
  56. } else {
  57.     echo "0 results";
  58. }
  59. $conn->close();
  60. ?>
  61.        
  62.        
  63.         </body>
  64.         </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top