# How to differentiate data in SQL query

**URL:** https://forum.kirupa.com/t/how-to-differentiate-data-in-sql-query/290179
**Category:** programming
**Created:** [June 10, 2009, 9:19pm UTC](https://forum.kirupa.com/t/how-to-differentiate-data-in-sql-query/290179 "2009-06-10T21:19:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![X\_plorer](https://avatars.discourse-cdn.com/v4/letter/x/b487fb/32.png) [@X\_plorer](https://forum.kirupa.com/u/X_plorer)
#### Post date: [June 10, 2009, 9:19pm UTC](https://forum.kirupa.com/t/how-to-differentiate-data-in-sql-query/290179/1 "2009-06-10T21:19:49Z")

</div>

Hi, I’m not expert for PHP but I’m able to make some working stuff. I have one table where are names of persons and other data. Until now I didn’t noticed that SQL doesn’t differentiate small and upper letters in table fields during SQL executing! :crying: So, if I have:

```php

$fname='Lance';
$lname='Hall';
//make query
$query = "SELECT kl_name, kl_lastname, kl_level FROM clients WHERE kl_name = '$fname' and kl_lastname ='$lname' ";
$result=mysql_query($query);
...

```

it gave me same result if $fname is Lance or LANCE Ⓜ!  
Inside table CLIENTS are already rows where exists also **Lance** and **LANCE**.  
Is there some way to make differentiate records according letter case and to be able to process only rows where $fname is Lance and other one when $fname is LANCE?  
Thank you.
