Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class garagemDAO {
- function __construct() {
- $this->con = new Conexao();
- $this->pdo = $this->con->Connect();
- }
- public function cadastrarGaragem($entGaragem) {
- try {
- $stmt = $this->pdo->prepare("insert into garagens"
- . "(cnpj, email, endereco, estado, nome, telefone, plano, logo)"
- . "values"
- . "(:cnpj, :email, :endereco, :estado, :nome, :telefone, :plano, :logo)");
- $param = array(
- ":cnpj" => $entGaragem->getCnpj(),
- ":email" => $entGaragem->getEmail(),
- ":endereco" => $entGaragem->getEndereco(),
- ":estado" => $entGaragem->getEstado(),
- ":nome" => $entGaragem->getNome(),
- ":telefone" => $entGaragem->getTelefone(),
- ":plano" => $entGaragem->getPlano(),
- ":logo" => $entGaragem->getLogo(),
- );
- return $stmt->execute($param);
- } catch (PDOException $ex) {
- echo "Erro 01: {$ex->getMessage()}";
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment