Jump to content

Same query different user_name error


mapleleaf

Recommended Posts

SELECT * FROM articles WHERE FIND_IN_SET(32, second_theme) AND user_name = 'Ram' AND deleted = 'No' ORDER BY date_added ASC

gives no results

SELECT * FROM articles WHERE FIND_IN_SET(32, second_theme) AND user_name = 'John' AND deleted = 'No' ORDER BY date_added ASC

gives results

 

 

Ram's second_theme:

 

58, 32

49, 46

49, 32

20, 1, 58

1, 58, 32

58, 32, 41

46, 32

48, 32

9, 41, 32

48, 32, 41

48

20, 41

48, 32

14, 8, 32

 

John's second_theme:

2, 4, 41

18

 

14

45, 9, 8

48,32,8

12

6

2, 9, 48

8

9, 48, 41

5, 13, 34

30, 3, 48

9, 3

14, 61, 8

52

52

46,15,3

2

12,32

 

 

Any ideas why this might happen? :confused:

 

 

Link to comment
Share on other sites

You can use a mysql REPLACE() function to remove all the spaces in the data -

 

REPLACE(str,from_str,to_str)

 

Returns the string str with all occurrences of the string from_str replaced by the string to_str. REPLACE() performs a case-sensitive match when searching for from_str.

 

mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');

        -> 'WwWwWw.mysql.com'

 

 

Link to comment
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.