If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > embedded MATCH request

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-22-10, 02:15
titiplanti titiplanti is offline
Registered User
 
Join Date: Sep 2010
Posts: 3
embedded MATCH request

Hi !

Topics of my forum link to a page of my annuary thanks to a MATCH request that work fine :
Code:
SELECT annuary_cat_id, annuary_cat_name
              FROM annuary_categories
              WHERE MATCH (annuary_cat_name,annuary_cat_text) AGAINST ("$forum_topic_title")
Inversely, I want that page of the annuary can list the forum topics which point towards that page of the annuary. But I have problems to find the good request. I tried :
Code:
SELECT topic_id, topic_title, annuary_cat_id, annuary_cat_name, annuary_cat_text
            FROM forum_topics, annuary_categories
            WHERE annuary_cat_id = "105"
            AND topic_id=(SELECT topic_id FROM forum_topics WHERE MATCH (annuary_cat_name,annuary_cat_texte) AGAINST (topic_title) LIMIT 0,1)
phpmyadmin (MySQL version 5.0.51a) says : "Incorrect arguments to AGAINST"

How can I do ?

Last edited by titiplanti; 09-22-10 at 08:59.
Reply With Quote
  #2 (permalink)  
Old 09-22-10, 03:46
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
so are there any differences between the two statements?
whats differe3nt between the one that works and the one that doesn't work?
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 09-22-10, 03:51
titiplanti titiplanti is offline
Registered User
 
Join Date: Sep 2010
Posts: 3
1st : AGAINST("$php_variable")
2nd : AGAINST(SQL field)

MySQL may not accept SQL fiel in AGAINST request. So, is there a manner to make what I want ? Any other manner ?
Reply With Quote
  #4 (permalink)  
Old 09-22-10, 07:34
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
is your column called annuary_cat_texte or annuary_cat_text?
also check your syntax, Im not convinced you can match against columns, the against I think has to be an expression not a column
MySQL :: MySQL 5.1 Reference Manual :: 11.9 Full-Text Search Functions
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 09-22-10, 09:05
titiplanti titiplanti is offline
Registered User
 
Join Date: Sep 2010
Posts: 3
annuary_cat_text (initial post edited)

Thank you for the link :
Quote:
The search string must be a literal string, not a variable or a column name.
... then we are sure !

Can you suggest me another manner to list the topics ?
Reply With Quote
Reply

Tags
mysql match sql request

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On