Don't use classes if you don't know where they are just send a normal query
$sql =("SELECT * FROM ads WHERE category = '%s' ORDER BY ".(($_GET['Hot'] == 'true') ? "views" : "date")." DESC", $_GET['cat']);
instead of
$sql->query("SELECT * FROM ads WHERE category = '%s' ORDER BY ".(($_GET['Hot'] == 'true') ? "views" : "date")." DESC", $_GET['cat']);
and so on, otherwise without including that class and creating a new instance of it you won't have anything but trouble.