I am getting this error when I call this script
Call to a member function prepare() on a non-object in C:\wamp\www\notary\classes\profile.php on line 11
line 11 is this $statment = $this-> db->prepare
what am I doing wrong
}[code=php] require_once '../common.php';
Class Profile extends PDO{
public $db;
public function __construct() {
$this->db = new Connection();
$this->db = $this->db->connect();
}
public function insert_profile($name,$company,$address1,$address2,$city,$state,$zip,$phone,$fax,$email){
$statment = $this-> db->prepare("INSERT INTO profile(name,company,address1,address2,city,state,zip,phone,fax,email) VALUES (?,?,?,?,?,?,?,?,?,?)");
$statment -> bindParam(1,$name);
$statment -> bindParam(2,$company);
$statment -> bindParam(3,$address1);
$statment -> bindParam(4,$address2);
$statment -> bindParam(5,$city);
$statment -> bindParam(6,$state);
$statment -> bindParam(7,$zip);
$statment -> bindParam(8,$phone);
$statment -> bindParam(9,$fax);
$statment -> bindParam(10,$email);
$statment -> execute();
}
public function get_profile($name) {
$statment = $this-> db->prepare("SELECT FROM profile WHERE name = ?");
$statment -> bindParam (1,$name);
$statment -> execute();
}[/code]