I'd like to help, but what problems are you having? Are you getting any error messages or anything? As for adding how much of an item a user has, you can use:
PHP Code:
$item = "nameofitem";
$hasitem = $mysidia->db->select("inventory", array("quantity"), "itemname ='{$item}' and owner='{$mysidia->user->username}'")->fetchColumn();
if($hasitem){
$document->add(new Comment("You have $hasitem {$item}!"));
It will show as:
You have [itemamount] [itemname]!