Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2. $host = "127.0.0.1";
  3. $user = "federico";
  4. $password = "****";
  5. $database = "film";
  6. $titolo = $_REQUEST['titolo'];
  7.  
  8. $db = mysql_connect($host,$user,$password) or die ("pirla non si connette al db cosa hai sbagliato"); //fino a qui tutto va
  9.  
  10. $mysql_select_db($database, $db) or die ("non si connette al db");
  11.  
  12. $query ="INSERT INTO film (titolo) VALUES('titolo')";
  13.  
  14. if (!mysql_query($query,$db))
  15. {
  16. print("impossibile inserire il dati");
  17. }
  18.  
  19. else
  20.  
  21. {
  22.  
  23. print("i dati sono stati inseriti");
  24.  
  25. }
  26.  
  27. mysql_close($db);
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement