I'm trying to insert data into the database using mysqli prepare but are not inserting the data, and does not show any error
Questions :::
- What am I doing wrong in this code below?
- Is this the best way to do it?
-
Could you put an example?
$conecta = new mysqli($hostname, $username, $password, $dbdatabase); if($conecta->connect_error){ echo "Conexao:<span class=\"ls-tag-danger\">Erro!</span>"; }else{ echo "Conexao:<span class=\"ls-tag-success\">OK!</span>"; } $sql = $conecta->prepare("INSERT INTO cotacao (chave,id_transfer,id_empresa,nome) VALUES (?,?,?,?)"); $sql->bind_param('s', $chave,$id_transfer,$idc,$nome); // $sql->execute(); $sql->close(); $conecta->close();
Thank you