Example #1
0
 public function Insert(Product $data)
 {
     try {
         $query = "INSERT INTO Productos (name, description, category, subcategory, image, active)\n                          VALUES (?, ?, ?, ?, ?, ?)";
         $this->pdo->prepare($query)->execute(array($data->__GET('name'), $data->__GET('description'), $data->__GET('category'), $data->__GET('subcategory'), $data->__GET('image'), $data->__GET('active')));
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }