Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching in SQL!

Status
Not open for further replies.

bomayed

Technical User
Joined
May 13, 2002
Messages
101
Location
AE
I'm using Arabic language and Arabic is not simple like English. For example those are four Arabic letters:
Ã Í È ß
when you put these letters together they will look like this
ÃÍÈß
this word means ( I love you ) ANYWAY!

I'm using a forum , when I search in my forum and I type the above word (ÃÍÈß) it will consider the first letter " which is on the right side (Ã) " as a separate word, and the other part (ÍÈß) as another word , as a result I will get MANY MANY incorrect results when I search in the forum.

I use the following statement in SQL :

If term LIKE Typed term , then display results . .

Can someone HELP to get more accurate results? :(

Thanks
 
bomayed,

I'd like to take a stab at this, but I need more information:

1. which SQL are you using? MySQL? Oracle? MS SQL?
2. what is the EXACT SQL statement you're using?

Thanks,
Inger
 
Thanks ingernet ,

I'm using MySQL

and the statement is written in .PHP file which is :

$sql = "SELECT tid, title FROM ".$prefix."_encyclopedia_text WHERE eid='$eid' AND text LIKE '%$query%'";

That's all
 
Okay my next question is: what happens when you search for other things? For example, what happens when you search for a term that doesn't contain any of those letters? Or search for a term that starts with the first letter, or contains the same second letter (that letter I wtih the...grave? accent? over it)?

What I'm getting at is that perhaps PHP is converting those characters to something other than what they symbolize to us (letters). I'm wondering what would happen if you searched for the ascii equivalents.

Very curious....

inger
 
$sql = "SELECT tid, title FROM ".$prefix."_encyclopedia_text WHERE eid='$eid' AND text LIKE '%$query%'";


This looks problematic to me... but maybe I'm misreading.

(Sorry I don't know the ascii codes so I'll make a new example)

You seem to suggest $query="habibi" is reasonable right?

Then you use it to populate the above $sql statement. And you'll get back all the statements containing habibi anywhere in them.

However, in your particular example, you doing..
$query = "h"
$quyer = "abibi"

so first you filter out all the texts which have an h in them, then look for any of the ones which contain the string "abibi"

Why is it you're separating the first letter? Is it the right to left reading?

Sorry if my questions are off base, but I'm hoping I can help if the problem is well defined.

-Rob
 
Thanks again for helping me here . .

I don't really know what is wrong with that SQL statement! But it looks like when I search for the word ( ÃÍÈß), the results I get is any word or any place in the text that contains those 4 letters( Ã Í È ß). .

For example , if I search for the word " Book " , I get results such as " Booking" . . which has totally different meaning.


ingernet, so if I type this letter (Ã), I will get 10,000 results cuz many words contains this letter.

I want the program to search exactlly for what I type in the search box. If I type (ÃÍÈß) I want results for this word , and if I type (ÃßÑåß) I want to get results for this word , I don't want the program to to search for any word that contains those letters!

I know it's difficult , but maybe someone will come up with an idea . . Thanks a gain
 
skiflyer , We separate letters sometimes in words because this is how it is in Arabic , ÃÍÈß means I love you , if you take the first letter of ( Ã) , it will be (ÍÈß) , which means now " Your Love" . . Totally diffrenet words and meanings.
 
BTW , !!!

If I type a word that doesn't exist like (ãäíÊÎíå ), I will get 0 results! This programs works the way it wants!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top