作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个数据库:
id | movie_name | genres
1 | Die Hard | Action, Thriller
2 | Gladiator | Adventure, Action, Drama, History
3 | Harry Potter and the Sorcerers Stone | Fantasy, Adventure, Family
4 | Pearl Harbor | Action, Melodrama, War
1)如何从所有数据库的流派
中选择独特的流派。我需要下一个: Action /冒险/剧情/家庭/奇幻/历史/情节剧/惊悚/ war
2)如何观看特定类型的电影?
SELECT `movie_name` FROM `movies` WHERE `genre` LIKE ??
但他不仅能带来戏剧,还能带来情节剧。
3) 如何搜索特定类型?可能是:
SELECT `movie_name` FROm `movies` WHERE `movie_name` LIKE `%stone%` AND `genres LIKE 'drama'.
最佳答案
不要在数据库列中存储以逗号分隔的属性列表。
相反,有 3 个表:
Movies (id, movie_name)
id | movie_name
---+--------------------------------------
1 | Die Hard
2 | Gladiator
3 | Harry Potter and the Sorcerers Stone
4 | Pearl Harbor
Genres (id, genre_name)
id | genre_name
---+------------
1 | Action
2 | Thriller
3 | Adventure
4 | Drama
5 | History
6 | Fantasy
7 | Family
8 | Melodrama
9 | War
MovieGenre (movie, genre)
Movie | Genre
------+-------
1 | 1
1 | 2
2 | 1
2 | 3
2 | 4
2 | 5
3 | 3
3 | 6
3 | 7
4 | 1
4 | 8
4 | 9
那么你的问题就会变得非常非常简单。
关于php - MySQL选择流派问题(php),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5423893/
我想使用 javascript 获取音频文件的标题和流派(按路径),以将其显示在我的网络音乐播放器上。这可能吗? 我现在找了很长时间,没有找到任何可以帮助我的东西。 最佳答案 的元信息MP3 文件 存
我正在尝试使用流派/标签上的过滤器来获取某些轨道,当它只有一种流派时它似乎可以工作,尽管当它是多个流派时它不起作用同时文档说它接受一个列表: https://developers.soundcloud
我仅使用 youtube-dl 从 youtube 视频中提取音频. 我想在下载后将元数据(即艺术家姓名和歌曲名称、年份、专辑、持续时间、流派)写入 mp3/m4a 文件。 我的尝试是从以下代码开始的
我是一名优秀的程序员,十分优秀!