FILTERS
I am building a mini project, on a wine warehouse and as I do not have much knowledge in back-end I am in doubt of how I can do product search filters, for example the wine has the year, type of wine, region and how can I cosntrui a search bar that makes this filter by the database data.
2 Replies
generally you'd write a WHERE statement for your SQL query based on the search term, something like
how you do wildcards in prepared statements varies a bit by the SQL flavor though
It depends what kind of database your are using and the structure of your database. In the example above type should probably store ID reference to type model/table or enum. Region also if you want maintainable and scalable database system.