Ask for help!Capital sensitive [SOLVED]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gonni
Forum Newbie
Posts: 2
Joined: Wed Oct 25, 2006 8:54 am

Ask for help!Capital sensitive [SOLVED]

Post 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"]));
			
		}
Last edited by gonni on Wed Oct 25, 2006 3:37 pm, edited 2 times in total.
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post by impulse() »

Code: Select all

strtoupper
strtolower
Hope that helps,
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
gonni
Forum Newbie
Posts: 2
Joined: Wed Oct 25, 2006 8:54 am

Post 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!
Post Reply