| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Nov 2006 Location: Lahore
Posts: 297
![]() | search functions in php please let me solve my search query problem when i use Where Clause in php query it returns meabsolute Result but i wanna use funtion as my keyword is Free Scripts and it will return matches for either Free or [COLOR=RED]Scripts[/RED] thanks in advance to all my helpers |
| |
| | #2 (permalink) |
| New Member Join Date: Oct 2007
Posts: 8
![]() | try using match in your query, of course to do that you will need to make the database field fulltext $sql="SELECT * FROM cheats WHERE MATCH(content) AGAINST ('$keyword')"; As I said, match can only be used on fields that are fulltext. |
| |
| | #4 (permalink) |
| New Member Join Date: Oct 2007
Posts: 8
![]() | Most definitly, match is designed for this purpose, of course you will need to structure your sql appropriatly $sql="SELECT * FROM cheats WHERE MATCH(content) AGAINST ('$keyword') and MATCH(content) AGAINST ('$keyword2')"; to match the field content against the values of the 2 keywords. There are stop words using match, I would suggest checking the PHP manual for more info. |
| |