Simple MySql or MySqli Class
Don't use either - PDO is much more user-friendly and feature-rich.  Generally a class will be nicer to write code around, and now that we have PDO we don't need to write that class.  The following example is largely stolen from here: https://phpdelusions.net/pdo

$DBUser = "root";
$DBPass = "";
$DBName = "test";
$DBCharset = 'utf8mb4';

$dsn = "mysql:host=$DBServer;dbname=$DBName;charset=$DBCharset";
$DBOptions = [
    PDO::ATTR_ERRMODE            =&gt; PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE =&gt; PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   =&gt; false,
];
try {
     $pdo = new PDO($dsn, $DBUser, $DBPass, $DBOptions);
} catch (\PDOException $e) {
     // to avoid a potential credentials leak through a stack trace
     throw new \PDOException($e-&gt;getMessage(), (int)$e-&gt;getCode());
}

$stmt = $pdo-&gt;prepare("SELECT * FROM test WHERE lname = ?");
$stmt-&gt;execute([$_GET['l_name']]);
$data = $stmt-&gt;fetchAll();

foreach ($data as $row) {
    echo "{$row['f_name']} {$row['l_name']}&lt;br&gt;";
}