CstAn
09-04-2006, 03:22 PM
i had created a search function on a web application.
the problem is, i try enter some of info to it, certain text can be found but certain text can be match although they are in database.
this my query:
$keywordu = strupper($keyword);
$keywordl = strlower($keyword);
$sql = "SELECT E.* FROM employes AS E, dvi_problem AS DV WHERE AS.empId = DV.empId AND (E.emp_name LIKE '%".$keyWordl."%' OR DV.reference LIKE '".$keywordi."''%".$keywordl."%' OR E.emp_name = '%".$keywordu."%' OR DV.reference LIKE '%".$keywordu."%')"
$query = mysql_query($sql, $db) or die('Fail to search.');
i test with direct copy the data from database, some string i copy can search it but some other string i copy direct it can work wo...
i try show out the variable $sql value, it show with not error, the keywordu n keywordl aslo show out the value when i print out the $sql variable.
any possible reason for it?
i had using php syntax.
thanks.
the problem is, i try enter some of info to it, certain text can be found but certain text can be match although they are in database.
this my query:
$keywordu = strupper($keyword);
$keywordl = strlower($keyword);
$sql = "SELECT E.* FROM employes AS E, dvi_problem AS DV WHERE AS.empId = DV.empId AND (E.emp_name LIKE '%".$keyWordl."%' OR DV.reference LIKE '".$keywordi."''%".$keywordl."%' OR E.emp_name = '%".$keywordu."%' OR DV.reference LIKE '%".$keywordu."%')"
$query = mysql_query($sql, $db) or die('Fail to search.');
i test with direct copy the data from database, some string i copy can search it but some other string i copy direct it can work wo...
i try show out the variable $sql value, it show with not error, the keywordu n keywordl aslo show out the value when i print out the $sql variable.
any possible reason for it?
i had using php syntax.
thanks.