Advertisement
Guest User

Untitled

a guest
Nov 26th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. ini_set('display_errors', 1);
  4.  
  5.  
  6. $i = 1 ;
  7. //Variables
  8. $username = "user";
  9. $password = "senha";
  10. $hostname = "localhost";
  11. //$ip_user = $_SERVER['HTTP_CLIENT_IP'] ;
  12. $db_name = "bannco de dados";
  13.  
  14. //connect to database
  15. $connection = mysqli_connect($hostname, $username, $password);
  16. if(!$connection){
  17. die("Database selection failed: " . mysqli_error());
  18. }
  19.  
  20. //Select database
  21. $db_select = mysqli_select_db($connection, $db_name) or die("Cannot find the database");
  22. if (!$db_select){
  23. die("Db selection failed: " . mysqli_error($connection));
  24. }
  25.  
  26. mysqli_query($connection, "delete from TABELA");
  27.  
  28.  
  29. mysqli_close($connection);
  30.  
  31.  
  32.  
  33.  
  34. ;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement