views:

92

answers:

1

I'm making a gallery, somewhat similar to Facebook's. I want users to be able to tag other users in photos, including non-registered users. Is it best to have a table in_photo with columns (user_id, name, photo_id) where user_id is null if the user is unregistered, and name is set, and vice-versa, or should I scrap the name column and create a temporary user or some other scheme?

+2  A: 

If there is any another metadata you'd store with the unregistered user - yes, create the temporary users or another table.

If all you store is name - I'd say the way you have it is fine. Although 'name' isn't very descriptive. Maybe 'unregistereduser_name' would be a better name for the column.

russau
Sounds fair ---
Mark