Discussion: Case sensitivity
Afficher un message
Vieux 23/09/2007, 16h09   #1
JimJx
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Case sensitivity

Hi all,

I know that searches in MySQL are supposed to be case insensitive so
this is driving me nutz...

Quick run down...

1 table, 13 columns.
Columns 1 - 12
are type text
collation is latin1_swedish_ci
Column 13
Set to mediumint autoincrement, primary key
collation is latin1_swedish_ci

So, I am searching with this:

$query = sprintf (
"SELECT name,address,city,phone, category
FROM valley
WHERE CONCAT_WS(' ',keywords,category) LIKE '%$search
%'
ORDER BY name LIMIT %d,%d",
$start - 1,
$per_page + 1);
}

The $search comes from a form. For example, if I enter 'books' in the
form I get no results. However, if I enter 'Books' in the form, I get
5 results, which is what I would expect from my db.

I know this got a little long, but I wanted to show what I had checked
and the outcome of everything.

If anyone has any ideas as to why this search is being case sensitive,
I would love to hear them. Or alternatively if anyone has a
workaround, that would also be greatly appreciated.

Jim

  Réponse avec citation
 
Page generated in 0,06235 seconds with 9 queries