For some reason, I can only select data from a table but I can't insert.
I.e. function nee() works fine, but wee() doesn't... It was working earlier today... anyone know the reason?
Class wtf{
private $db;
public function __construct(){
$this->db = new Store_Connection();
$this->db = $this->db->dbStore();
}
public function nee(){
$st = $this->db->prepare("select paid from sales where id=14");
$st->execute();
$product = $st->fetch(PDO::FETCH_OBJ);
print_r($product);
}
public function wee(){
$st = $this->db->prepare("insert into sales(paid) values (sdf)");
$st->execute();
}
}
$work = new wtf();
$work->wee();
$this->db = new Store_Connection();smells like bad code.$this->db = new Store_Connection(); $this->db = $this->db->dbStore();