CE

May I ask you a database search question, please? I am useless with databases but I know how to search for one item at a time in my website's; I just put in the item code (e.g. wk660) at the pd_code line in the phpMyAdmin search page, but I don't know how to search for more than one item in a single search.

I want to search for several items in one search, using more than one item code at a time. I tried... wk660 OR wk30 OR wk483 to search for three at the same time but it didn't find anything, although all three can be found if I do them one at a time.

I also tried separating them with AND and I tried enclosing the product codes in %%. None worked. My Google searches haven't helped me find how to do it. Can you tell me what I should put in to search for several items in one search, please?

There is a screenshot below of the phpMyAdmin search page to show what I mean. The line I put the item code into is pd_code, you can see one item code in it in the picture:

add a comment
0

1 Answer

  • Votes
  • Oldest
  • Latest
BW

From the pulldown menu instead of choosing LIKE, choose REGEXP. Then for the value separate each thing you are searching for with a pipe symbol, which is '|'. So for instance you would put this for the value:

wk660|wk30|wk483

Let me know if that does the trick 🙂

  • 0
    Yay! It found and displayed all three I put in. Thank you — cerio
add a comment
0