I have a table where users enters there username in both lower case(eg: arup) and uppercase(eg: Arup) or both (eg: aRuP).
But my problem is now that if I search database to show member username like %Arup, mysql returns empty result if not founds exactly.
id | username | name | sex
1 arUp Arup Sarma Male
<?php
$q=strip_tags($_POST['user']); /// eg. Arup
$qry=mysql_fetch_row(mysql_query("SELECT id,name,sex FROM membertable WHERE username='%$q'"));
echo $qry['0']."<br>".$qry['1']."<br>".$qry['2'];
?>
/// Now above sql query will return zero result as there is no username in the form of arUp.
How to make SQL query Case-insensitive ? anyone help please...