You're missing the glue
parameter for implode()
. Without that, your $query
would look something like this:
SELECT * FROM estudos WHERE author='FooBarBaz'
This is a syntactically valid SQL query, but it doesn't do what you want.
You're probably looking for the IN
clause.
$query .= " WHERE author IN (" . implode (',', $author) .")";
Note that I haven't fixed the SQL injection vulnerabilities in your query. I recommend you switch to MySQLi or PDO and start using parameterized queries to be safe from SQL injection.