I have these lines of PHP code:
$sql2 = "INSERT INTO TableName ... " //an example, line is very long
error_log($sql2);
$result2 = $this->conn->query($sql2); //line 81
I get this error in PHP error log:
PHP Warning: mysqli::query(): Couldn't fetch mysqli in /volume1/web/DB_Functions.php on line 81
My first idea was that my $sql2 string is not valid, but when I copied it from PHP error log and pasted it to PhpMyAdmin as SQL it works pretty well, what could be wrong?