Advertisement
Guest User

Untitled

a guest
Mar 11th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. class DB_con {
  4.  
  5. public $servername = "localhost";
  6. public $username = 'root';
  7. public $password ='admin';
  8. public $dbname ='test';
  9. public $conn;
  10. function __construct() {
  11. $this->conn = mysqli_connect($this->servername,$this->username,$this->password,$this->dbname);
  12. if (!$this->conn) {
  13. die('Error in connection');
  14. }
  15. }
  16.  
  17. public function signup($name,$email,$password)
  18. {
  19. $query = mysqli_query($this->conn,"insert into signup(username,email,password) values('$name','$email','$password')");
  20. if ($query){
  21. echo "record insert.";
  22. }
  23. else{
  24. echo "something gone wrong.";
  25. }
  26. }
  27. }
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement