I have a Array named $category which has values in string format.
I want to add it in query such that I can filter the results by category.
Something Like this:
SELECT * FROM ig_accounts WHERE category IN (Array Values here)
So the query becomes something like:
SELECT * FROM ig_accounts WHERE category IN ('text','fashion','sports')
Right now I am using this, which has an error:
$query = "SELECT * FROM ig_accounts WHERE category IN (".
for($i=0;$i<$category[NULL];$i++)
{
echo '$category[$i]';
}
.")";
echo, concatenate. Useforeachto. What is$category[NULL]?fordo$query .=also use"variables in single quotes aren't processed.