Jump to content

[SOLVED] PHP Uppercase and Lower Case Problems When Using The LIKE Function


jj20051

Recommended Posts

I have a script setup that searches through a database of links. The problem is that if you type 'google' in nothing comes up, but if you type 'Google' in results come up. The title of the pages in the database all have a capital G at the beginning. Bellow are the two links:

 

http://apenex.net/search.php?search=google

http://apenex.net/search.php?search=Google

 

Here is the query I'm using:

 

$search = "`keywords` LIKE '%{$keyword}%' OR `title` LIKE '%{$keyword}%' OR `description` LIKE '%{$keyword}%' OR `sample` LIKE '%{$keyword}%'";

$query = "SELECT COUNT(*) as num FROM sites WHERE {$search} ORDER BY totalrating DESC";

 

 

If you have an idea, that would be great. I tried using the strtolower() function, but there was no result. I could make the whole database lowercase, but that would take a while.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.