Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
1,205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "localhost";
  4. $username = "root";
  5. $password = "";
  6. $dbname = "emildeveloping2";
  7.  
  8. // Skapa anslutning
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10. // Anslutnings Check
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. $sql = "SELECT id, customerid, product, name, email, adress, securitynumber, city, zipcode, country, taxnumber, companyname, cost, paymentplan, paid FROM purchases ORDER BY id";
  16. $result = $conn->query($sql);
  17.  
  18. if ($result->num_rows > 0) {
  19. echo "<table id='purchases' class='purchases'><tr class='header'><th>Invoice ID</th><th>Customer ID</th><th>Product</th><th>Name</th><th>Email</th><th>Adress</th><th>Security Number</th><th>City</th><th>Zip Code</th><th>Country</th><th>Cost</th><th>Payment Plan</th><th>Status</th><th>Options</th></tr>";
  20. // Visa datan
  21. while($row = $result->fetch_assoc()) {
  22. echo "<tr><td>" . $row["id"]. "</td><td>" . $row["customerid"]. "</td><td>" . $row["product"]. "</td><td>" . $row["name"]. "</td><td>" . $row["email"]. "</td><td>" . $row["adress"]. "</td><td>" . $row["securitynumber"]. "</td><td>" . $row["city"]. "</td><td>" . $row["zipcode"]. "</td><td>" . $row["country"]. "</td><td>" . $row["cost"]. "</td><td>" . $row["paymentplan"]. "</td><td>" . $row["paid"]. "</td><td><a class='fas fa-check-square' href='update.php'></a></td></tr>";
  23. }
  24. echo "</table>";
  25. } else {
  26. echo "There is no active calls.";
  27. }
  28.  
  29. $conn->close();
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement