Javascript Pass Variable Into Function In Sql