Hi All
I would like to implement a photos uploaded an approval process, in my web site , so Members that uploaded a picture , will be in a waiting status for picture to be approoved.
i have the Picture name known in my php code, and i would like to set a flag in the Database for each picture that is approoved or not. there are only 2 status : approoved / not approved.
My question is how to use the DB structure if i know that in the future i will have like more than 4 pictures ?
thanks
Moshe
Pictures Approoving
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Pictures Approoving
What do you mean, more than 4 pictures? I thought this was about an approval process, so I'm going to assume you meant to say 4 different flags in the database. Well, according to normalization, you would seperate the flags into their own respective table, and perform an inner join to combine the tables.mbaroz wrote:My question is how to use the DB structure if i know that in the future i will have like more than 4 pictures ?
TABLE - Status
Code: Select all
ID | DESCRIPTION
0 Pending
1 Approved
2 Declined
..etcCode: Select all
ID | STATUS_ID | PICTURE
0 0 jcart.jpg
1 2 bleh.jpg
2 2 bleh.jpgCode: Select all
SELECT * FROM `pictures` INNER JOIN `status` ON `status`.`id` = `pictures`.`status_id`