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.