在尝试运行查询时,我得到这个“错误:调用字符串上的成员函数查询()”并且似乎找不到修复

Setting up a website and trying to get an image to display using values from a database.

Tried changing variables, and redoing the databse, not much has worked. Here is the different code used, starting with the problem area. the error says the issue is with 'line 5'. And secondly the database connection code.

<?php
    require "../includes/header.php";
    require "../includes/db_handler.php";
    $sql = "SELECT * from products WHERE featured = 1";
    $featured = $db->query($sql);
?>

------------------------------------------------------


<?php
    $server = "*******";
    $username = "*****";
    $password = ""; 
    $db = "******";

    $conn = mysqli_connect($server, $username, $password, $db);