fix sql syntax in get_info_from_item function