An analogy to my problem, 
So I have a table named sample\_table, it has 1 field named input. The sample\_table has 2 records, "A" and "B". My program can update either of the two, and there is a validation. If I change "B" to "A", it will be invalid, (A is already existing). Same on changing "A" to "B" (B is already existing). This validation works because before the update query happens, I will do a select query, checking if the value is already existing, and if no value is existing then update will happens. The problem is, if I update "B" into lowercase "b", my program validates and detect B is already existing. How can I update B to b? That is what I want to happen.

My codes

```
 <?php

function update()
{

$sup_id = $_POST['flavor_id'];
$flavor_name = $_POST['flavor_name2'];
$flavor_name = trim($flavor_name);

$sql = "update flavor set flavor_name = :flavor_name where id = :sup_id";

$stmt = "SELECT * FROM flavor WHERE flavor_name=:flavor_name";

try
{               
$STM2= $conn -> prepare($stmt);                                        
$STM2->bindparam(":flavor_name", $flavor_name);
$STM2 -> execute();
$row=$STM2->fetch(PDO::FETCH_ASSOC);

if(strtolower($row['flavor_name'])==strtolower($flavor_name))
{
 echo " <p class=failed> Flavor is already existing </p>";
}
else
{
$STM = $conn -> prepare($sql);                                    
$STM->bindparam(":sup_id", $sup_id);
$STM->bindparam(":flavor_name", $flavor_name);
$STM -> execute();
echo " <p class=success> Flavor Updated</p> "; }
}
catch( PDOException $e )
{
echo $e->getMessage();
}
}

?>        

```