0

From the URL 'http://www.example.com/community/teams/photo-gallery'. Using the path /community/teams/photo-gallery how can I query the database to get the results of the menu. Please note that the menu slug are not unique.

So that means only results about community, teams, photo-gallery should show.

Here is my attempt

SELECT * FROM menu WHERE menu_slug = 'community' AND menu_slug = 'teams' AND menu_slug = 'photo-gallery'

This Query won't work in my situation

SELECT * FROM menu WHERE menu_slug = 'community' OR menu_slug = 'teams' OR menu_slug = 'photo-gallery'

Database Struture enter image description here

Red Virus
  • 1,633
  • 3
  • 25
  • 34

2 Answers2

0

Try:

SELECT * FROM menu WHERE menu_slug = 'community' OR menu_slug = 'teams' OR menu_slug = 'photo-gallery';

OR

SELECT * FROM menu WHERE menu_slug IN ('community', 'teams', 'photo-gallery');
Bernd Buffen
  • 14,525
  • 2
  • 24
  • 39
0

Just it? o.o

SELECT * FROM menu WHERE menu_slug = 'community' OR menu_slug = 'teams' OR menu_slug = 'photo-gallery'

Or you're talking about this? htaccess url rewriting, ignoring files

Community
  • 1
  • 1
KodornaRocks
  • 425
  • 3
  • 14