How to perform multiple selects without using for loop
If you can sanitize input, you can use an IN statement.

SELECT *
FROM t
WHERE id IN ( 1,2,3 );


Or you can chain the WHERE clauses.

WHERE ID = 1 OR ID = 2;