Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DB_con {
- public $servername = "localhost";
- public $username = 'root';
- public $password ='admin';
- public $dbname ='test';
- public $conn;
- function __construct() {
- $this->conn = mysqli_connect($this->servername,$this->username,$this->password,$this->dbname);
- if (!$this->conn) {
- die('Error in connection');
- }
- }
- public function signup($name,$email,$password)
- {
- $query = mysqli_query($this->conn,"insert into signup(username,email,password) values('$name','$email','$password')");
- if ($query){
- echo "record insert.";
- }
- else{
- echo "something gone wrong.";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement