PHP login page using prepared statements
There are several problems with your code. 


An extra query to get exactly the same row you just requested 
Unreliable password hashing
Inconsistent query handling with strange query()/confirm() pair.
A lot of things intermixed here - POST, database internals, everything.


To make it better you have to store passwords after hashing them with password_hash() function and also utilize an improved version of query() function. 
So the final code would be like this (it is using my simple DB wrapper which is based on PDO, but could be implemented using mysqli as well). So the idea is that you do all the prepared statements' related stuff inside the database class, and never touch it inside a user function.

function login_new_member($email, $password)
{
    $user = DB::run("SELECT * FROM users WHERE email=? AND com_code IS NULL", [$email]);

    // you really should switch to password_hash/password_verify    
    // and make the following line as 
    // if ($user &amp;&amp; password_verify($password, $user['pass']))
    // but for now
    if ($user &amp;&amp; md5($password) === $user['password']))
    {
        if ($user['user_closed'] == 'yes')
        {
            DB::run("UPDATE users SET user_closed='no' WHERE email=?", [$email]);
        }
        $_SESSION['log_email'] = $user['email'];
        $_SESSION['username'] = $user['username'];
        header("Location: ../public/member/indexhold.php?register_new");
        exit();
    } else {
        echo "Email or password was incorrect";
    }
}


so this function should be called like this

if(isset($_POST['login_button'])) {
    login_new_member($_POST['log_email'], $_POST['log_password'])
}