Skip to content
Advertisement

Use more placeholders in WHERE statement after IN statement with arrays

I need more placeholders to be added to the following query. Is this possible? I have no idea where to begin and I can not find any options on the Internet.

The query now:

JavaScript

The query I am aiming for:

JavaScript

Advertisement

Answer

The easiest solution would be to use PDO instead of mysqli. This would be so much easier.

If you are stuck with mysqli then you can achieve a similar thing by simply ignoring the types and appending your result to the array.

JavaScript

You could even write a function to abstract from all of this code.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement