Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. $host = "localhost";
  3. $database = "root";
  4. $user = "root";
  5. $password = "";
  6.  
  7. $conn = mysql_connect($host, $user, $password) or die("impossibile connettersi");
  8. $db = mysql_select_db($database, $conn) or die ("impossibile selezionare il database ");
  9. if ($conn AND $db) print "OK";
  10. //$open = fopen("text.txt", "a+");
  11. //$contenuto = fread($open, filesize("text.txt"));
  12.  
  13. //if (feof($open)) break;
  14.  
  15. //$lines = file("text.txt");
  16.  
  17. //foreach ($lines as $k =>$v) {
  18.  
  19. //$a = $lines[0];
  20. //print $a;
  21.  
  22. //print $k . $v;
  23.  
  24. print(mysql_query("INSERT INTO `lista_site`(`id`, `sito`, `nome`) VALUES (1, test, est)") ? "ok" : "errore");
  25.  
  26. //}
  27. //fclose($open);
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement