Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['nome'] && empty($_POST['nome'] == false){
- $nome = addslaches($_POST['nome']);
- $descricoes = addslaches($_POST['descricoes']);
- $entrada = addslaches($_POST['entrada']);
- $saida = addslaches($_POST['saida']);
- $sql = "INSERT INTO anotacoes 'nome, descricoes, entrada, saida, data' VALUES '".$nome."', '".$descricoes."', '".$entrada."', '".$saida."', NOW()";
- $sql = pdo->query($sql);
- echo "<script> window.alert("INSERIDO COM SUCESSO !");</script> ";
- }
- ?>
- CONEXÃO BANCO DE DADOS.
- <?php
- $dsn = "mysql:dbname=NOMEDOBANCODEDADOS;host=localhost";
- $dbuser = 'root';
- $dbpass = '';
- try{
- $pdo = new PDO($dsn, $dbuser, $dbpass);
- } catch (PDOException $e){
- echo "Falhou a conexao:".$e->getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement