Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once ("Vehicle.class.php");
- //extends= kan eigenschappen en functies van vechile gebruiken
- class Car extends Vechile{
- public function Save(){
- $conn = new PDO('mysql:host=localhost;dbname=cars', 'root','root');
- // $conn = Db::getInstance();
- $query = "insert into cars (brand, price) VALUES (:brand, :price)";
- $statement = $conn->prepare($query);
- $statement->bindValue(':brand', $this->getBrand() );
- $statement->bindValue(':price', $this->getPrice() );
- $res = $statement->execute();
- var_dump($res);
- return $res;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement