Advertisement
Guest User

dbfunctions.php

a guest
Mar 27th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. //Update Contractor info
  2. function addUpdate($postalcode, $description, $phonenumber, $contract_type, $location)
  3. {
  4.  
  5. $conn = openDatabase();
  6. $description = $_POST['description'];
  7. $postalcode = $_POST['postalcode'];
  8. $phonenumber = $_POST['phonenumber'];
  9. $location = $_POST['location'];
  10. $contract_type = $_POST['contract_type'];
  11. $id = $_SESSION['user_id'];
  12.  
  13. $sql="UPDATE contractors SET description='$description', contract_type='$contract_type', phonenumber='$phonenumber', postalcode='$postalcode', location='$location' WHERE id='" . $_SESSION['user_id'] . "'";
  14. $result=mysqli_query($conn, $sql);
  15.  
  16. if ($result)
  17. {
  18. $message = "Contractor update succeeded";
  19. }
  20. else
  21. {
  22. $message = "Error updating contractor";
  23. }
  24.  
  25. closeDatabase($conn);
  26.  
  27. return $message;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement