Tien
3-25-05, 01:39 AM
I try to use the LIKE in my query for searching but it will not match with some other characters in the database therefore, search cannot be found.
Here is the problem:
the information in the database contain apostrophe but instead of regular apostrophe it is this character in my information '
for example: "My friend's name" will be like this in my database "My friend's name"
Now when I do the search using php script it will return nothing because it doesn't match with what in the database. The search is showing "My friend's name" but in the database is "My friend's name". So there is no match!
But that is not the only problem that I have. Now in my database I also have information using regular apostrophe but not '
So now how can I do a query so that it will match both apostrophe and ' ?
$find = @$_GET["find"];
$find = trim(strtolower($find));
query("SELECT tid,title,views,description FROM $tb1 WHERE forum_id='$forumid' AND LOWER(description) LIKE '$find%' ORDER BY `description`,`title`,`tid` ASC ","1");
Here is the problem:
the information in the database contain apostrophe but instead of regular apostrophe it is this character in my information '
for example: "My friend's name" will be like this in my database "My friend's name"
Now when I do the search using php script it will return nothing because it doesn't match with what in the database. The search is showing "My friend's name" but in the database is "My friend's name". So there is no match!
But that is not the only problem that I have. Now in my database I also have information using regular apostrophe but not '
So now how can I do a query so that it will match both apostrophe and ' ?
$find = @$_GET["find"];
$find = trim(strtolower($find));
query("SELECT tid,title,views,description FROM $tb1 WHERE forum_id='$forumid' AND LOWER(description) LIKE '$find%' ORDER BY `description`,`title`,`tid` ASC ","1");