The structure of the database is wierd usually you can only have one primary key for a database. I would not make the userid or type a primary key because there will be duplicates in the table. I would use an autonumber, guid, or timestamp as the primarykey