| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Specific ID's to be pulled out; SQL | |
|---|---|
| Tweet Topic Started: Mar 16 2005, 10:38 AM (332 Views) | |
| SkItZo | Mar 16 2005, 10:38 AM Post #1 |
|
Support Volunteer
![]() ![]() ![]() ![]() ![]()
|
I have this script of which an SQL command is executed. It's taking data from "ranks" table I have. Now, the problem is, I only want a certain few members to be shown at this page of where the SQL command is executed. There isn't a seperate "usergroup" table, but there is a "rank_id" field at the members table. I know for sure that it's the one deciding on which usergroup you are. So, I'm wondering, how can I pull data from that table from members only having a rank_id of '1,2,3,4,101'' Here's the current code:
|
![]() |
|
| Stefan | Mar 16 2005, 11:04 AM Post #2 |
![]()
Mew?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Maybe? :unsure: [/SQL newb] |
![]() |
|
| Dennis | Mar 16 2005, 11:47 AM Post #3 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Maybe instead of in the query, put it in the variable.
Then for the query
![]() That may hopefully work. I'm pretty new to this as well. |
![]() |
|
| kingy | Mar 16 2005, 01:00 PM Post #4 |
|
1 in 10 people understands binary, the other 1 doesn't
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
you use phpmyadmin? if so use that to make the code for you, using the server side seacrh function |
![]() |
|
| Seth | Mar 16 2005, 02:06 PM Post #5 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Silly rabbits, use IN().
|
![]() |
|
| Mez | Mar 17 2005, 02:39 AM Post #6 |
|
Zetaboards: now RFC2324 Compliant
![]() ![]() ![]() ![]() ![]() ![]()
|
glad someone posted that - I was about to go on a slapping spree. Yeah, the IN() function is your best call It's very useful for just selecting certain Id's
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
2:37 PM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)





It's very useful for just selecting certain Id's
2:37 PM Jul 11