|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
MySQL fulltext search throwing error??
any help with this problem would be great
![]() if i use this sql statement: $query = "SELECT * FROM vinyl WHERE MATCH (artist) AGAINST ('$search_text');"; and this while($r=mysql_fetch_array($result)) all is fine. works well BUT if i add columns like this: $query = "SELECT * FROM vinyl WHERE MATCH (artist, title, label) AGAINST ('$search_text');"; it throws this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource where am i going wrong? |
|
#2
|
|||
|
|||
|
i believe, that you should seperate the query, so that there is ONE query for each of the 3 places you want to query from.
|
|
#3
|
|||
|
|||
|
using a die error() i get this message:
Can't find FULLTEXT index matching the column list but i have added fulltext index on all the columns all the tutorils i have seen suggest you can just add column headers separated by commas... ie: Example 3.26. 19.php (excerpt) // Select all rows but display relvance $sql = "SELECT *, MATCH (title, body, author) AGAINST ('The PHP Anthology Released Long Word Matching') AS score FROM articles ORDER BY score DESC"; |
|
#4
|
|||
|
|||
|
ok because i hate it when search engines chuck forum pages with no answers on
this is what was going worng... in PHPMyAdmin you can click on fields to add fulltext indexes. DO NOT DO THIS if you want to be able to add columns to your query as above. instead run this command: ALTER TABLE `vinyl` ADD FULLTEXT (artist, label, title) to create ONE index specifying the columns ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > MySQL fulltext search throwing error?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|