1
I’m having trouble counting columns because I don’t know how to input the data by PDO
when you have a id AUTO_INCREMENT
that comes before the variable nome
. I don’t know exactly how to insert the id
along with the other data. Ai gives error in column count. Someone can help me?
$cadNome = strip_tags($_POST['nome']);
$cadEmail = strip_tags($_POST['email']);
$cadTelefone = strip_tags($_POST['telefone']);
$cadCeular = strip_tags($_POST['celular']);
$cadCidade = strip_tags($_POST['cidade']);
$cadDatepicker = strip_tags($_POST['datepicker']);
$cadEstimada = strip_tags($_POST['estimada']);
$cadComentarios = strip_tags($_POST['comentarios']);
$cadData = 'NOW()';
$stmt = $pdo->prepare('INSERT INTO wp_contato VALUES(:nome, :email, :telefone, :celular, :cidade, :datepicker, :estimada, :comentarios, :datacontato)');
$stmt->execute(array(
':nome' => $cadNome,
':email' => $cadEmail,
':telefone' => $cadTelefone,
':celular' => $cadCeular,
':cidade' => $cadCidade,
':datepicker' => $cadDatepicker,
':estimada' => $cadEstimada,
':comentarios' => $cadComentarios,
':datacontato' => $cadData
));
Already solved. Just waiting for the system to authorize to mark as best answer. Thank you.
– Marcos Vinicius
Show! Any questions just ask!
– AndersonBS