I want to create a VIEW, which contains parameters submitted by user (POST). I use mysqli prepared statemets to make it secure.
The query fails with an error:
Error 1351: View's SELECT contains a variable or parameter.
The query is: CREATE VIEW emailletters_view_11 AS SELECT * FROM clients WHERE c_title LIKE CONCAT('%', ?, '%')
I need to create views using parameters from users because these views are actually filters that users create on where web page. I don't want to store filter parameters and compose sql query each time the filter is used. I want to store each filter as separate view in by database.
What would you recommend?