Advertisement
Guest User

Untitled

a guest
May 31st, 2017
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. $con = mysql_connect("$localhost","$username","$password","$database");
  3. $localhost = '127.0.0.1'; // host
  4. $username = 'root'; //User
  5. $password = 'password'; //password
  6. $database = 'World'; //Database
  7.  
  8. if (!$con)
  9.   {
  10.   die('Could not connect: ' . mysql_error());
  11.   }
  12.  
  13. mysql_select_db("my_db", $con);
  14.  
  15. $sql="INSERT INTO accounts (login, password, gm, banned, email,)
  16. VALUES
  17. ('$_POST[login]','$_POST[pasword]','0','0','$_POST[email]')";
  18.  
  19. if (!mysql_query($sql,$con))
  20.   {
  21.   die('Error: ' . mysql_error());
  22.   }
  23. echo "1 record added";
  24.  
  25. mysql_close($con)
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement