Skip to content

Instantly share code, notes, and snippets.

@erick-jeronimo
Created April 3, 2019 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erick-jeronimo/944daea644849f6a01eb373652f6f551 to your computer and use it in GitHub Desktop.
Save erick-jeronimo/944daea644849f6a01eb373652f6f551 to your computer and use it in GitHub Desktop.
<?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