|
-
Jun 23rd, 2006, 10:26 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] MySQL: Query with more than one id(s)
how can you make MySQL get results relating to more than 1 id(s)(say like 5, 45, 6)
-
Jun 23rd, 2006, 10:34 AM
#2
Re: MySQL: Query with more than one id(s)
select * from table_name where id = 5 or id = 45 or id = 6
-
Jun 23rd, 2006, 10:40 AM
#3
Thread Starter
Fanatic Member
Re: MySQL: Query with more than one id(s)
that was what i first tried when i needed to do this in the first place but it returned no results.
-
Jun 23rd, 2006, 12:05 PM
#4
Re: MySQL: Query with more than one id(s)
Are the ID's string or numerical data type in the database?
-
Jun 23rd, 2006, 02:09 PM
#5
Lively Member
Re: MySQL: Query with more than one id(s)
Or, where id in(5, 45, 6). If it doesn't work you'll have to give us more to go with.
-
Jun 24th, 2006, 05:22 AM
#6
Thread Starter
Fanatic Member
Re: MySQL: Query with more than one id(s)
sorry for replying late...
 Originally Posted by kfcSmitty
Are the ID's string or numerical data type in the database?
the id's are numerical in the database.
-
Jun 24th, 2006, 06:13 AM
#7
Re: MySQL: Query with more than one id(s)
reply #2 and reply #5 both give you a solution.
-
Jun 24th, 2006, 06:22 AM
#8
Thread Starter
Fanatic Member
Re: MySQL: Query with more than one id(s)
yes it does... thanks
just wanted to reply to kfcSmitty's post
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|