Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Page Title</title>
- </head>
- <body>
- <h1>FORM SUCCESSFULLY SENT</h1>
- <p>Here are the order details</p>
- <?php
- $servername = xxxx;
- $username = xxxx;
- $password = xxxx;
- $databasename = xxxx;
- $conn = new mysqli($servername, $username, $password, $databasename); // Create connection
- if ($conn->connect_error) die("Connection failed: " . $conn->connect_error); // Check connection
- $sql_query = "SELECT * FROM orders";
- $result = mysqli_query($conn,$sql_query);
- ?>
- <table border="3" style= "background-color: #84ed86; color: #761a9b; margin: 5 auto;" >
- <thead>
- <tr>
- <th>Name</th>
- <th>Surname</th>
- <th>Start City</th>
- <th>End City</th>
- <th>Tracking Number</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if (!$result) throw new Exception('Database error: ' . mysql_error());
- else
- {
- while($row = mysqli_fetch_assoc($result))
- {
- echo "<tr>";
- echo "<td>".$row['client_name']."</td>";
- echo "<td>".$row['client_surname']."</td>";
- echo "<td>".$row['client_start_city']."</td>";
- echo "<td>".$row['client_end_city']."</td>";
- echo "<td>".$row['order_tracking_number']."</td>";
- echo "</tr>";
- echo "</table>";
- }
- $result->free(); // free result set
- }
- ?>
- </tbody>
- </table>
- <?php
- $conn->close();
- ?>
- </body>
- </html>
- echo "</table>";
- while($row = mysqli_fetch_assoc($result))
- {
- echo "<tr>";
- echo "<td>".$row['client_name']."</td>";
- echo "<td>".$row['client_surname']."</td>";
- echo "<td>".$row['client_start_city']."</td>";
- echo "<td>".$row['client_end_city']."</td>";
- echo "<td>".$row['order_tracking_number']."</td>";
- echo "</tr>";
- }
- echo "</table>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement