If the problem is in query:
$requete = "SELECT * FROM contact WHERE LOWER( nom ) = LOWER( '$search' )";
or else:
$search = mb_strtolower( $search );
$requete = "SELECT * FROM contact WHERE LOWER( nom ) = '$search'";
Or equivalent function, because the DBMS was not specified in the question. Remembering that in this case it is fundamental to use the collation correct for the language in use in the languages involved.
The SQL Injection comes free in all these codes. Give a searched here at the same Sopt, has a series of answers explaining how to solve. Regardless of the original question, your code sooner or later will give you a serious problem with this
If the problem is in the name of the parameters:
Normally this should not be necessary, and should only be used if there is a conscious reason for it. In general, it’s best to use coherence when naming everything in PHP (and any other language). Looking at the current situation of the question, I believe that the first part of the answer is the solution, not this.
With this line we normalize the marry of the parameters:
$_POST_MIN = array_change_key_case( $_POST, CASE_LOWER );
And then use it this way, always in lowercase:
if (isset($_POST_MIN['search']))
{
$search= htmlentities($_POST_MIN['search']);
}
It is important that accentuation is ignored?
– Marcio Mazzucato
in PHP or Sqlite?
– Daniel Omine
solved using ucwords($search);
– akm