Sql lowercase

Hi how do i make any form inputs to my database automatically lowercase im using this code.

$results = $db->prepare(“INSERT INTO entries (entry_name,entry_description,entry_date,entry_time) VALUES (:entry_name,:entry_description,:entry_date,:entry_time)”);

If you are referring to the data then you need to do it to the data variables that are coming in and NOT the query string.

You should look in to this - https://www.php.net/manual/en/function.strtolower.php

I was kind of wrong you can do that in mysql - How to Convert Uppercase Characters to Lowercase in MySQL | Database.Guide though that looks only for data coming in.

Sponsor our Newsletter | Privacy Policy | Terms of Service