Jump to content

Select where row=value OR where row=value?


DaveLinger

Recommended Posts

here's the deal. I'm still working on the game review site. Each review has a section id, (2 digits, like "12") which are related to which platforms the game is on. An example:

12 - PS2
13 - Xbox
14 - PC
15 - PS2 and Xbox
16 - PS2 and Xbox and PC
17 - Xbox and PC

I have 2 lists of reviews, one for Xbox games, one for PS2 games. I was hoping to have MySQL select the results of rows with EITHER "12" OR "15" OR "16" on the PS2 list, so that on the Xbox list I could have it select 13 15 16 and 17. Is there an easy way to add this into my existing code? right now it's something like:

SELECT * FROM my_table WHERE sid = '12' ORDER BY title DESC
Link to comment
https://forums.phpfreaks.com/topic/14434-select-where-rowvalue-or-where-rowvalue/
Share on other sites

do you have a field that contains the game type, like PS2, Xbox, or PC?
something like this:

sid    types:
12    PS2
13    Xbox
14    PC
15    PS2,Xbox
16    PS2,Xbox,PC


u know? it's much easier if you have a field in database which indicated the type of games for each review. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.