Welcome Guest, Not a member yet? Register   Sign In
Selecting records based on ID
#1

[eluser]RS71[/eluser]
Hey,

I'm trying to select some records from the database based on their ID. Normally I'd just do

Code:
SELECT * FROM table WHERE table.ID = 1

I'm gonna be storing all the possible IDs in a session variable; would I just append a

Code:
...OR table.ID = 2 OR table.ID = 3 (etc)

or is there a better way to do this? Would I have some problems if I need to retrieve some 50 different rows from the table?

Thanks in advance.


Messages In This Thread
Selecting records based on ID - by El Forum - 03-09-2009, 03:51 PM
Selecting records based on ID - by El Forum - 03-09-2009, 03:58 PM
Selecting records based on ID - by El Forum - 03-09-2009, 04:04 PM
Selecting records based on ID - by El Forum - 03-09-2009, 04:07 PM
Selecting records based on ID - by El Forum - 03-10-2009, 09:26 AM
Selecting records based on ID - by El Forum - 03-10-2009, 09:41 AM
Selecting records based on ID - by El Forum - 03-11-2009, 10:51 AM
Selecting records based on ID - by El Forum - 03-11-2009, 11:12 AM
Selecting records based on ID - by El Forum - 03-11-2009, 11:40 AM
Selecting records based on ID - by El Forum - 03-11-2009, 11:55 AM
Selecting records based on ID - by El Forum - 03-11-2009, 12:15 PM
Selecting records based on ID - by El Forum - 03-11-2009, 12:43 PM
Selecting records based on ID - by El Forum - 03-11-2009, 01:28 PM
Selecting records based on ID - by El Forum - 03-11-2009, 02:12 PM
Selecting records based on ID - by El Forum - 03-11-2009, 08:57 PM
Selecting records based on ID - by El Forum - 03-11-2009, 09:00 PM
Selecting records based on ID - by El Forum - 03-11-2009, 09:12 PM
Selecting records based on ID - by El Forum - 03-11-2009, 09:15 PM
Selecting records based on ID - by El Forum - 03-11-2009, 09:35 PM
Selecting records based on ID - by El Forum - 03-11-2009, 09:46 PM
Selecting records based on ID - by El Forum - 03-12-2009, 07:23 AM
Selecting records based on ID - by El Forum - 03-12-2009, 07:28 AM
Selecting records based on ID - by El Forum - 03-12-2009, 07:40 AM
Selecting records based on ID - by El Forum - 03-12-2009, 07:53 AM
Selecting records based on ID - by El Forum - 03-12-2009, 12:04 PM
Selecting records based on ID - by El Forum - 03-12-2009, 01:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB