Need some help with SQL Lite

I am trying to retrieve the values stored in my table but I am getting as undefined. Can anyone help me on this please.
$scope.saveProduct=function(select,productname,days,quan){
days=parseInt(days,10);
quan=parseInt(quan,10);
var query=“INSERT INTO product (productCategory,productName,days,quantity)VALUES(?,?,?,?)”;
$cordovaSQLite.execute(db,query,[select,productname,days,quan]).then(function(res){
alert(“Id->”+res.insertId);},function(err){
alert(err);
}

        );
       alert(select+":"+productname+":"+days+":"+quan);


    }
    $scope.selectquery=function(){
        var query="SELECT count(id) as cnt from product";
        $cordovaSQLite.execute(db,query,[]).then(function(res){
           $scope.result=res.rows.item(1);
            if(res.rows.length>0) {


                alert(res.rows[i]);
            }

        });
    }