Così l'inizializzazione della sessione al login può andare?

Codice PHP:
<?php
    session_start
();
    require_once(
'mysqlconnect.php');
    
mysql_select_db($database$users);
    
$bSuccesso true;
    
$verDB false;
    
$id htmlspecialchars($_POST['username']);
    
$password htmlspecialchars($_POST['password']);
    if (
strlen($id) <= 0)
        
$bSuccesso false;
    if (
strlen($password) <= 0)
        
$bSuccesso false;
    
    
$sql "SELECT * FROM users WHERE username='".$id."'";
    
$resource mysql_query($sql$users);
    while (
$row mysql_fetch_assoc($resource)) {
        if (
$row['password'] == $password) {
            
$verDB true;
        }
    }
?>

<html>
<head><title>Login</title>
<?php
if ($bSuccesso && $verDB) {
    
// avvio sessione utente
        
$_SESSION['utente']= array("username"=>$id['id']);
    
// fine avvio sessione utente