Check out example codes for "mysql where in array". It will help you in understanding the concepts better.

Code Example 1

-- SQL
SELECT * FROM table WHERE column IN('value1','value2','value3')

-- Javascript
$string="1,2,3,4,5";
$array=array_map('intval', explode(',', $string));
$array = implode("','",$array);
$query=mysqli_query($conn, "SELECT name FROM users WHERE id IN ('".$array."')");

Code Example 2

$sql = 'SELECT * 
          FROM `table` 
         WHERE `id` IN (' . implode(',', array_map('intval', $array)) . ')';

Learn ReactJs, React Native from akashmittal.com