In a database I have this field: "TeST". I don’t know where the upper case characters are. I just want to strtolower them and do something like this:
SELECT * FROM table WHERE strtolower(field) = strtolower($var)
How can I do that?
Using PDO and assuming MySQL
$stmt = $db->prepare('SELECT * FROM table WHERE LOWER(`field`) = ?');
$stmt->execute(array(strtolower($var)));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With