1
error trying to send data.
public function __construct()
{
try{
$this->conn = new PDO("mysql:dbname=lic_database;host=localhost;","root","root");
}catch(Exception $e){
echo $e->getMessage();
}
}
public function setTable(){
$conexao = $this->conn;
$res = $this->conn->prepare("INSERT INTO user ( username, email, password, create_time)
VALUES (:u, :em, :pas, :dt )");
$nNome = $this->getNome();
$nSenha = $this->getSenha();
$nEmail = $this->getEmail();
$objDateTime = new DateTime('NOW');
$res->bindparam(":u",$nNome);
$res->bindparam(":em",$nEmail);
$res->bindparam(":pas",$nSenha);
$res->bindParam(":td", $objDateTime);
$res->execute();
}
Probably there was some error when connecting in the bank, its class does not prevent the execution of the query there is an error, because in
try/catch
you just display the error message.– Pedro Sanção
I’ll try to connect in the old mysql xampp of it, I was trying to connect by Workbench
– Vitor Giovanny
Solved, I went to php.ini, removed the ";" from Extension=mysqli Extension=pdo_mysql
– Vitor Giovanny