Created
April 3, 2019 22:12
-
-
Save erick-jeronimo/944daea644849f6a01eb373652f6f551 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'conexao.php'; | |
$stmt = $conn->prepare("INSERT INTO cliente(nome, email, cnpj) values(:nome, :email, :cnpj)"); | |
$stmt->bindParam(':nome', $_POST['nome']); | |
$stmt->bindParam(':email', $_POST['email']); | |
$stmt->bindParam(':cnpj', $_POST['cnpj']); | |
try | |
{ | |
$stmt->execute(); | |
header("Location: listar.php"); | |
} | |
catch(PDOException $e) | |
{ | |
echo "Erro: " . $e->getMessage(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment