Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class connDb{
- private $link;
- private $host;
- private $user;
- private $pass;
- private $dbname;
- public function __construct($host, $user, $pass, $dbname){
- $this->host=$host;
- $this->user=$user;
- $this->pass=$pass;
- $this->dbname=$dbname;
- $this->link=mysqli_connect($this->host, $this->user, $this->pass, $this->dbname)
- OR
- die("Not connected to MySQL");
- }
- }
- ?>
- <?php
- $conn1=new connDb("localhost", "root", "", "dbind");
- $xyz=$conn1->prepare("INSERT INTO table1 VALUES(?, ?, ?)");
- $x="vikas";
- $y="vikas@gmail.com";
- $z="123n";
- $xyz->bind_param('sss', $x, $y, $z);
- $xyz->execute();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement