prepare("SELECT SUM(size) AS sum FROM files WHERE owner=:uid");
$sql->execute(array(":uid"=>$_SESSION['id']));
$used=$sql->fetch(PDO::FETCH_ASSOC)['sum']; //in B
$sql=$db->prepare("SELECT quota FROM users WHERE id=:uid");
$sql->execute(array(":uid"=>$_SESSION['id']));
$total=$sql->fetch(PDO::FETCH_ASSOC)['quota']; //in MB
?>