display gridview based on user login id

I have these tables

table1: building(Model: Building): building_id, building_name, zone_id

table2: zonal_administrator(Model: ZonalAdministrator): zonal_id, zone_id, zonal_user_id

The zonal administrator has its login account which i have created. I want it that when the zonal administrator logs in it will display gridview for building with building.zone_id = zonal_administrator.zone_id. Where the login_id = zonal_user_id.

The Gridview is in this format:

Building_id | Building_name | zonal_id

Please help me.


An idea is to use sqldataprovider having the query that you want (something like "select * from building where zone_id=$id)

I tried it as you suggested. An error came up that "php intl extension is required"

Please help.

What OS have you?


Thanks. It works.