Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. ini_set("display_errors", 1);
  4. $db_host = "localhost";
  5. $db_user = "***";
  6. $db_password = "***";
  7. $db_name_sms = "Mailing";
  8.  
  9. $con_sms = mysqli_connect($db_host, $db_user, $db_password, $db_name_sms);
  10.  
  11. if($con_sms){
  12. echo "connesso";
  13. }else{
  14. echo "non connesso";
  15. }
  16. if (!$p_file = fopen("1.csv","r")) {
  17. echo "Spiacente, non posso aprire il file 1.txt";
  18. } else {
  19. while(!feof($p_file))
  20. {
  21. $linea = fgets($p_file, 255);
  22. $query = "DELETE FROM MailingList WHERE Email='$linea'";
  23. if($con_sms->query($query)){
  24. echo "Mail ".$linea." cancellata <br />";
  25. echo $query."<br />";
  26. }else{
  27. echo "Mail ".$linea." non cancellata";
  28. }
  29. }
  30. fclose($p_file);
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement