Check boxes search Criteria

Hey everyone,

I’m currently writing a website and what I need is to be able to seach for items in the data base that contain a value selected with checkboxes and then choose a random one and display it. So you check the ratings of say movies you want to watch, you select PG, M and MA but not G and R and then it searches through it’s data base for all movies with any one of the selected ratings and then selects a random movie and displays it. The problem is I’m not sure how to do it. Is there a tutorial that anyone knows of that covers this sort of thing? I am trying to modify the user roles from the sitepoint joke database that you build when reading from dynamic websites using php and mysql but that is just for adding not searching by so I can’t get it to work.

Thanks heaps guys!

depends on how you have your data base designed

sql statement can be select * from table where rating=‘g’ or ’ rating=‘m’ or rating=‘ma’ etc…