Guest User

Untitled

a guest
May 26th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. auth();
  4.  
  5. function auth() {
  6.  
  7. $connection = mysql_connect ("localhost", "root", "gov291f5541_nasa");
  8. if ($connection == false)
  9. {
  10.     print ("Połączenie connect");
  11.     mysql_error ();
  12.     return false;
  13. }
  14.  
  15. $result =  mysql_select_db ("test");
  16. if ($result == false)
  17. {
  18.     print ("Baza");
  19.     mysql_error();
  20.     return false;
  21. }
  22. $liczba = mt_rand(100000, 999999);
  23.  
  24.  
  25.  
  26. $q = "INSERT INTO ggczat_auth (`numer`, `nick`, `kanal`, `pass`) VALUES ('0',
  27. 'NPP', 'kanalik', '". mt_rand(2, 100)."')";
  28. print ($q);
  29.  
  30. $result = mysql_query($q);
  31. if ($result == NULL)
  32. {  
  33. mysql_error();
  34. return false;
  35. }
  36.  
  37.  
  38. return $liczba;
  39.  
  40.  
  41.  
  42.  
  43. }
  44.  
  45.  
  46. ?>
Add Comment
Please, Sign In to add comment