I have a database with a list of products, with a “title” text field and a “category” text field The two fields have that the texts entered contain both uppercase and lowercase characters On the page with the product list I have two search text boxes, associated with the variables Everything works perfectly, except that the search string must be case sensitive. Instead, I would like the search to be complete regardless of case I have tried various solutions, but to no avail Does anyone know how to intervene with Wappler? Thank you
How do you filter your database fields currently?
What database are you using? What server model?
Database MySql Ubuntu - NodeJS - Bootstrap 5 - Hetzner Cloud
Action with GET text Variables -> filter_product and filter_category
I wish I could insert the filters without case sensitivity
The filter case sensitive depends on how you setup your database table, you’ve probably setup the table with a case sensitive collation.
MySQL :: MySQL 8.0 Reference Manual :: B.3.4.1 Case Sensitivity in String Searches
Thanks Patrick
I am not particularly aware of database settings. I study the link you pointed out to me for a while
I cannot intervene with Wappler’s Database Manager, I have to understand if I can intervene on the database using Navicat or if I have to do it on Ubuntu
Before I screw up, I want to understand one thing
It is correct that the database field texts have uppercase and lowercase letters and should not be converted all into lowercase.
My problem is that the texts entered for the search do not differentiate between upper and lower case, in order to carry out a complete search of the text
It is currently not possible to set the collation from within Wappler. I don’t know about Navicat, but I suppose that it will probably support it.
The collation is something like utf8_general_ci
or utf8_general_cs
where ci
stands for case insensitive and sc
for case sensitive. Changing the collation should not change any character case in your database.
When making changes where you don’t know how it will impact it is adviceable to first make a backup of your database before applying these changes.
Fixed with Navicat
I changed the field setting -> Collation = utf8_general_ci
Thank you
If you want to leave the DB as it is, just use a data view and client side filtering… use lowercase() in your filter on both sides
The idea is great but how would you do that on the server side? I think that’s only possible with a custom query, isn’t it?