Guest User

Untitled

a guest
Jul 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function unsubscribe($email_id, $created_at){
  2. $servername1 = "name";
  3. $username1 = "name";
  4. $password1 = "pass";
  5. $dbname1 = "dbName";
  6.  
  7. // Create connection
  8. $conn1 = mysqli_connect($servername1, $username1, $password1, $dbname1);
  9. // Check connection
  10. if (!$conn1) {
  11. die("Connection failed: " . mysqli_connect_error());
  12. }
  13. $timestamp = strtotime($created_at);
  14. $sql = "update email_list set unsubscribed = '" . $timestamp . "' where emailaddress = '" . $email_id . "'";
  15. echo "OnServer Date = " . $created_at . " and Timestamp = " . $timestamp . " and email = " . $email_id . "<br>";
  16. mysqli_query($conn1, $sql);
  17. mysqli_close($conn1);
  18. }
Add Comment
Please, Sign In to add comment