A
A
Alexey Konovalov2018-01-28 17:05:27
MySQL
Alexey Konovalov, 2018-01-28 17:05:27

Is there an alternative for WHERE IN?

Hello! The API structure assumes the possibility of obtaining users by their ID. Just like the VKontakte API https://vk.com/dev/users.get
But how to implement this on the server side?
This is the only method that comes to mind. because IDs are already written separated by commas. Making a request:

SELECT * FROM `users` WHERE `id` IN(12233456, 11235488, 4521233546,.....)

But this is probably not the right approach? What if there are too many IDs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2018-01-28
@Alk90

right. limit the quantity, as VK does, if you carefully read the documentation. don't forget to protect yourself from sql injections

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question