MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 22nd, 2004, 07:43 PM
ultras_uk ultras_uk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 ultras_uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old May 22nd, 2004, 08:44 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
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.

Reply With Quote
  #3  
Old May 23rd, 2004, 04:19 AM
ultras_uk ultras_uk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 ultras_uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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";



Reply With Quote
  #4  
Old May 23rd, 2004, 06:01 AM
ultras_uk ultras_uk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 3 ultras_uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > MySQL fulltext search throwing error??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT