X
X
Xveeder2018-04-12 09:45:15
MySQL
Xveeder, 2018-04-12 09:45:15

How to display data from a specific id list from MySQL?

Good afternoon.
Suppose we have the following table:

id     data
1      text
2      text
3      text
4      text  
...
99    text

I have an array with id: [2, 4, 17, 74]
How to extract rows with id from an array from a table? Of course, you can make 4 queries in a loop, but can you somehow extract these 4 records without creating 4 queries to the database?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Antonio Solo, 2018-04-12
@solotony

... where `id` in (2, 4, 17, 74)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question