0
Shows this error:
Uncaught Error: Call to a member function bind_param() on boolean in /opt/lampp/htdocs/sala/class/Config.class.php:35
In my file it’s like this:
public function Cadastrar(string $nick,string $senha,string $status, int $online_status) {
$this->Query = $this->Conexao->prepare("INSERT INTO usuarios (nick,senha,sexo,status,online_status) VALUES (?,?,?,?)");
$this->Query->bind_param("sssi",$nick,$senha,$status,$online_status);
$this->Query->execute();
return "Registrado com sucesso!";
}
One of the problems is that there are 5 columns
(nick [1] ,senha [2] ,sexo [3] ,status [4],online_status[5])
, but there are only 4 values(? [1],? [2] ,? [3] ,? [4])
. This is one of the mistakes, maybe there are others.– Inkeliz
i took the sex and keeps giving error, now the number of columns is all right, I can insert it well if I am going to do it in the same class file, but when using require or include to instantiate the class, ai gives that error
– Otavio Fagundes
Oops, you’re right, now that I realized I took out the sex variable I had but I ended up leaving sex in the same column, vlw man
– Otavio Fagundes