# How to ignore case sensitivity?

**URL:** https://forum.kirupa.com/t/how-to-ignore-case-sensitivity/235254
**Category:** Uncategorized
**Created:** [August 9, 2007, 6:05pm UTC](https://forum.kirupa.com/t/how-to-ignore-case-sensitivity/235254 "2007-08-09T18:05:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)
#### Post date: [August 9, 2007, 6:05pm UTC](https://forum.kirupa.com/t/how-to-ignore-case-sensitivity/235254/1 "2007-08-09T18:05:47Z")

</div>

In my users table in mysql, the usernames are laid out like so: FirstInitialLastName(ie: RSwietek)

With my login script, its requires you type RSwietek and nothing else, so rswietek wouldn’t work. How could I make it so it ignores the case sensitivity? Here is my php code.

```php
<?php
$username = $_POST['username'];
$password = md5($_POST['password']);
$submit = $_POST['Submit'];
if($submit != "") {
   $con = mysql_connect("localhost","username","password");
   if (!$con) {
      echo "unable to connect to DB";
      echo mysql_error($con);
      exit();
   }
   $db = mysql_select_db("datron");
   if (!$db) {
      echo "unable to open DB";
      echo mysql_error($db);
      exit();
   }
    $query = "SELECT * FROM users WHERE username = '$username' AND password = '$password';";
    $rs = mysql_query($query);
    if(!mysql_num_rows($rs)){
        die("<b>Bad login1</b>");
     } else {
        while($row = mysql_fetch_assoc($rs)){
           if($username == $row['username'] && $password == $row['password']){
              $_SESSION['loggedIn'] = 'yes';
           $_SESSION['username'] = $username;
              header("Location: art.php");
           }
        }
        echo "<b>Bad login!</b>";
     }
  }
?>

```

thanks guys.  
-ronnie
