case sensitive query?
Posted: Mon Jul 13, 2009 5:41 pm
I'm pulling records from a database with these 2 queries:
and
However, the search variable I am using in the first query($stud) seems to be case sensitive while $dir is not.
For example, if I want to find all movies by the studio Warner Brothers, searching for 'warner' returns no results. But at the same time searching for 'scorsese' in my director search will return results of Martin Scorsese.
Is there anyway to explain this? The code of both are identical minus the variable name. Thanks in advance if you have any advice.
Code: Select all
$stud=$_POST['stud'];
$stud=mysql_real_escape_string($stud);
if ($_POST['stud']!="")
{
$sql="SELECT * FROM movies WHERE studio like '%" . $stud . "%'";Code: Select all
$dir=$_POST['dir'];
$dir=mysql_real_escape_string($dir);
if ($_POST['dir']!="")
{
$sql="SELECT * FROM movies WHERE director like '%" . $dir . "%'";For example, if I want to find all movies by the studio Warner Brothers, searching for 'warner' returns no results. But at the same time searching for 'scorsese' in my director search will return results of Martin Scorsese.
Is there anyway to explain this? The code of both are identical minus the variable name. Thanks in advance if you have any advice.