Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Apprentice{
- public $servername = 'localhost';
- public $username = 'root';
- public $password = 'root';
- public $dbname = 'test';
- public $fullname;
- public $email;
- public $mobile;
- public $apprenticeship;
- public $experience;
- public $school_level;
- public $certification;
- public $cv_path;
- public $driving_license;
- function __construct(){
- $conn = new mysqli($this->servername, $this->username, $this->password, $this->dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- }
- function insertData($fullname,$email,$mobile,$apprenticeship, $experience, $school_level,$certification, $cv_path, $driving_license){
- $this->$fullname;
- $this->$email;
- $this->$mobile;
- $this->$apprenticeship;
- $this->$experience;
- $this->$school_level;
- $this->$certification;
- $this->$cv_path;
- $this->$drivinglicense;
- $stmt = $conn->prepare ("INSERT INTO Apprentice (fullname, email, mobile,apprenticeship, experience, school_level, certification, resume, drivinglicense VALUES (?,?,?,?,?,?,?,?,?)");
- $stmt->bind_param($fullname, $email, $mobile,$apprenticeship, $experience, $school_level,$certification, $cv_path, $driving_license);
- $stmt->execute();
- }
- }
- $Apprentice = new Apprentice();
- $Apprentice::insertData('pulkit','p@gmail.com','9815381537','test','test','test','test','test',55);
- ?>
Add Comment
Please, Sign In to add comment