Guest User

Untitled

a guest
Feb 17th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. $servername = "localhost";
  2. $username = "root";
  3. $password = "";
  4. $dbname = "emildeveloping2";
  5.  
  6. // Create connection
  7. $conn = new mysqli($servername, $username, $password, $dbname);
  8. // Check connection
  9. if ($conn->connect_error) {
  10. die("Connection failed: " . $conn->connect_error);
  11. }
  12.  
  13. $sql = "UPDATE purchases SET paid='Paid'";
  14.  
  15. if ($conn->query($sql) === TRUE) {
  16. echo "Record updated successfully";
  17. } else {
  18. echo "Error updating record: " . $conn->error;
  19. }
  20.  
  21. $conn->close();
  22. ?>
  23.  
  24. $result = $conn->query($sql);
  25.  
  26. if ($result->num_rows > 0) {
  27. 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>";
  28. // Visa datan
  29. while($row = $result->fetch_assoc()) {
  30. 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>";
  31. }
  32. echo "</table>";
  33. } else {
  34. echo "There is no active calls.";
  35. }
Add Comment
Please, Sign In to add comment