I have this function:
function envia($mensgem) {
$odb = mysqli_connect(HOST, USER, PASS, DATABASE);
mysqli_query($odb, "INSERT INTO pedidos VALUES ('$mensagem')");
mysqli_close($odb);
}
I use this function on another page calling it by require('funcoes/envia.php');
, I execute this function using envia('Olá mundo');
, I will see in phpMyAdmin and nothing has been registered.
I would like the insert to execute within functions to facilitate:)
PS: HOST, USER, PASS and DATABASE have been set correctly