Jump to content

Recommended Posts

I have a simple select but it wont return the values i need, maybe someone can tell me why its doing this:

 

Table 1:

 

            v_id v_word

70 south

69 park

68 brub

67 brrub

66 brrrrub!

 

Table2:

 

                l_id l_word_id        l_vid_id

70 70,69,68,67,66 834785

 

SELECT * FROM  `vid_loc` AS l, vid_words AS v WHERE MATCH v.v_word AGAINST ('south park' IN BOOLEAN MODE) AND v.v_id IN (l_word_id) 
GROUP BY v.v_id 

 

This returns:

 

l_id l_word_id               l_vid_id v_id v_word

70 70,69,68,67,66 834785 70 south

 

but this selects the two rows i need:

SELECT * FROM  `vid_loc` AS l, vid_words AS v WHERE MATCH v.v_word AGAINST ('south park' IN BOOLEAN MODE) AND v.v_id IN (70,69,68,67,66) 
GROUP BY v.v_id 

 

This returns:

 

l_id l_word_id        l_vid_id v_id v_word

70 70,69,68,67,66 834785 69 park

70 70,69,68,67,66 834785 70 south

 

 

So the question is:  IN (l_word_id)  and  IN (70,69,68,67,66) both have the same value but why do they return different results?

 

Link to comment
https://forums.phpfreaks.com/topic/220620-select-in/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.