Advertisement
Guest User

Untitled

a guest
Jan 18th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. use DBI;
  2.  
  3. $db ="zabawki";
  4. $user = "root";
  5. $pass = "";
  6. $host="localhost";
  7.  
  8. print "Podaj nowe nazwa:";
  9. $temp = <>;
  10. chomp($temp);
  11. print "Podaj nowe cena:";
  12. $temp2 = <>;
  13. chomp($temp2);
  14.  
  15.  
  16. $dbh = DBI->connect("DBI:mysql:$db:$host", $user, $pass);
  17. $query = "INSERT INTO zabawki (nazwa, cena) VALUES(?,?)";
  18. $sqlQuery = $dbh->prepare($query)
  19. or die "Blad";
  20.  
  21. $rv = $sqlQuery->execute($temp, $temp2)
  22. or die "Blad";
  23. $rc = $sqlQuery->finish;
  24. exit(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement