daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Jul 21st, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Page Title</title>
  5. </head>
  6. <body>
  7.  
  8. <h1>FORM SUCCESSFULLY SENT</h1>
  9.  
  10. <p>Here are the order details</p>
  11.  
  12. <?php
  13.     $servername = xxxx;
  14.     $username = xxxx;  
  15.     $password = xxxx;  
  16.     $databasename = xxxx;
  17.     $conn = new mysqli($servername, $username, $password, $databasename);           // Create connection
  18.     if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);    // Check connection
  19.     $sql_query = "SELECT * FROM orders";
  20.     $result = mysqli_query($conn,$sql_query);
  21.  
  22. ?>
  23. <table border="3" style= "background-color: #84ed86; color: #761a9b; margin: 5 auto;" >
  24.       <thead>
  25.         <tr>
  26.           <th>Name</th>
  27.           <th>Surname</th>
  28.           <th>Start City</th>
  29.           <th>End City</th>
  30.           <th>Tracking Number</th>
  31.         </tr>
  32.       </thead>
  33.       <tbody>
  34.         <?php
  35.           if (!$result) throw new Exception('Database error: ' . mysql_error());
  36.           else
  37.           {
  38.               while($row = mysqli_fetch_assoc($result))
  39.               {
  40.                  echo "<tr>";
  41.                  echo "<td>".$row['client_name']."</td>";
  42.                  echo "<td>".$row['client_surname']."</td>";
  43.                  echo "<td>".$row['client_start_city']."</td>";
  44.                  echo "<td>".$row['client_end_city']."</td>";
  45.                  echo "<td>".$row['order_tracking_number']."</td>";
  46.                  echo "</tr>";
  47.                  echo "</table>";
  48.               }
  49.               $result->free();  // free result set
  50.           }
  51.         ?>
  52.       </tbody>
  53.     </table>
  54. <?php
  55.       $conn->close();
  56. ?>
  57.  
  58. </body>
  59. </html>
  60.    
  61. echo "</table>";
  62.    
  63. while($row = mysqli_fetch_assoc($result))
  64. {
  65.      echo "<tr>";
  66.      echo "<td>".$row['client_name']."</td>";
  67.      echo "<td>".$row['client_surname']."</td>";
  68.      echo "<td>".$row['client_start_city']."</td>";
  69.      echo "<td>".$row['client_end_city']."</td>";
  70.      echo "<td>".$row['order_tracking_number']."</td>";
  71.      echo "</tr>";
  72. }
  73. echo "</table>";
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