PDA

Click to See Complete Forum and Search --> : [RESOLVED] MySQL: Query with more than one id(s)


modpluz
Jun 23rd, 2006, 10:26 AM
how can you make MySQL get results relating to more than 1 id(s)(say like 5, 45, 6)

penagate
Jun 23rd, 2006, 10:34 AM
select * from table_name where id = 5 or id = 45 or id = 6

modpluz
Jun 23rd, 2006, 10:40 AM
that was what i first tried when i needed to do this in the first place but it returned no results.

kfcSmitty
Jun 23rd, 2006, 12:05 PM
Are the ID's string or numerical data type in the database?

{yak}
Jun 23rd, 2006, 02:09 PM
Or, where id in(5, 45, 6). If it doesn't work you'll have to give us more to go with.

modpluz
Jun 24th, 2006, 05:22 AM
sorry for replying late...

Are the ID's string or numerical data type in the database?

the id's are numerical in the database.

visualAd
Jun 24th, 2006, 06:13 AM
reply #2 and reply #5 both give you a solution.

modpluz
Jun 24th, 2006, 06:22 AM
yes it does... thanks
just wanted to reply to kfcSmitty's post