Why my insert-form isn't works?
public function safeCar() {
$asd = "INSERT INTO
'Car'(mark,
model,
year,
state_num,
mileage,
colour,
consumption,
cost_less_30_inc,
cost_more_31)
VALUES('$this->mark',
'$this->model',
$this->year,
$this->state_num,
$this->mileage,
'$this->colour',
$this->consumption,
$this->cost_less_30,
$this->cost_more_31)";
echo($asd);
$this->db->prepare($asd)->execute();
I'm sending form via POST and trying to add data into DB. But php sent me a error
Fatal error: Uncaught Error: Call to a member function prepare() on string in ...
..
But my string looks so good
INSERT INTO 'Car'(mark, model, year, state_num, mileage, colour, consumption, cost_less_30_inc, cost_more_31) VALUES('Fiat', 'Punto', 2003, 345, 32929, 'black', 7, 10, 7)
it works in phpMyAdmin
Where I made a mistake?
var - db its PDO object