Page 1 of 1

Ask for help!Capital sensitive [SOLVED]

Posted: Wed Oct 25, 2006 9:12 am
by gonni
Hi,

Anybody knows how to get rid of capital-sensitive in the following code?

I found the results were capital sensitive.

means I need to input "HELLO" instead of "hello" if I want the term found in database (the term in database is

"HELLO").

Code: Select all

mysql_pconnect ("localhost", "root");
	
mysql_select_db ("ejunic");
 
	$search_term = $_POST ["search_term"];
	
	$result_search = mysql_query ("SELECT publication FROM issn_vertify WHERE publication LIKE '%${search_term}%'");
	
	echo $search_term;
	
	$num = mysql_num_rows($result_search);
	
	for ($i=0; $i<$num; $i++)
		{
			$row = mysql_fetch_array ($result_search);
			echo "$i. Title:";
			echo htmlspecialchars (stripslashes($row ["publication"]));
			
		}

Posted: Wed Oct 25, 2006 9:16 am
by impulse()

Code: Select all

strtoupper
strtolower
Hope that helps,

Posted: Wed Oct 25, 2006 10:04 am
by volka
Please run the query

Code: Select all

SHOW CREATE TABLE issn_vertify
and post the result. The field publication is probably defined as binary.
see http://dev.mysql.com/doc/refman/5.0/en/ ... ivity.html

Posted: Wed Oct 25, 2006 3:37 pm
by gonni
volka wrote:Please run the query

Code: Select all

SHOW CREATE TABLE issn_vertify
and post the result. The field publication is probably defined as binary.
see http://dev.mysql.com/doc/refman/5.0/en/ ... ivity.html

Yeah!

I changed the 'publication' field collation from utf8-bin into utf8-unicode_ci.

It really works.

Thanks a lot!