I'm have a problem when I want to query to the database , in this case I want to using IN() mysql function for searching data by value field on array.
example I have array from php
$data = array(1,2,3,4);
and this is my query code to selection data on table Employee
$query = 'SELECT * FROM employee_tbl
-> WHERE daily_typing_pages IN ' .$data.;
when I'm execute that code I have error like this
Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array
SELECT * FROM employee_tbl
-> WHERE daily_typing_pages IN Array;
I think that error is come because Array read as string,and don't parse to this format (1,2,3,4)
how i can convert to that format ? any suggestion?