Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. include_once ("Vehicle.class.php");
  3. //extends= kan eigenschappen en functies van vechile gebruiken
  4. class Car extends Vechile{
  5.  
  6. public function Save(){
  7. $conn = new PDO('mysql:host=localhost;dbname=cars', 'root','root');
  8. // $conn = Db::getInstance();
  9.  
  10. $query = "insert into cars (brand, price) VALUES (:brand, :price)";
  11.  
  12. $statement = $conn->prepare($query);
  13. $statement->bindValue(':brand', $this->getBrand() );
  14. $statement->bindValue(':price', $this->getPrice() );
  15. $res = $statement->execute();
  16. var_dump($res);
  17. return $res;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement