I paresume that the username is also stored in a database table along with the addresses. So query the database table using that username (username must be a unique one, otherwise there should be some user_id in the session as well). Do something like this: