来自网址' http://www.example.com/community/teams/photo-gallery'。使用路径/community/teams/photo-gallery
如何查询数据库以获取菜单的结果。请注意,菜单slug不是唯一的。
这意味着只显示community
,teams
,photo-gallery
的结果。
这是我的尝试
SELECT * FROM menu WHERE menu_slug = 'community' AND menu_slug = 'teams' AND menu_slug = 'photo-gallery'
此查询无法在我的情况下工作
SELECT * FROM menu WHERE menu_slug = 'community' OR menu_slug = 'teams' OR menu_slug = 'photo-gallery'
答案 0 :(得分:0)
尝试:
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');
答案 1 :(得分:0)
就是这样吗? o.o
SELECT * FROM menu WHERE menu_slug = 'community' OR menu_slug = 'teams' OR menu_slug = 'photo-gallery'