我试图从版本表中获取数据并附上每个版本的链接,尝试使用此查询执行此操作:
$links = $this->app->db->rawQuery("SELECT r.name, r.nfo, r.quality, l.*
FROM Movies_DReleases r
INNER JOIN Release_Links l
ON r.id = l.release_id
WHERE r.movie_id = ?", array($id));
及其给出的结果
Array
(
[0] => Array
(
[name] => DVD Release
[nfo] => This is description name NFO
[quality] => DVDRip
[id] => 1
[release_id] => 18
[host] => TC
[language] => en
[link] => google.com
)
[1] => Array
(
[name] => DVD Release
[nfo] => This is description name NFO
[quality] => DVDRip
[id] => 2
[release_id] => 18
[host] => TC
[language] => de
[link] => google.de
)
[2] => Array
(
[name] => HDTVRip Release
[nfo] => Second Release Description
[quality] => HDTVRip
[id] => 4
[release_id] => 19
[host] => TC
[language] => fr
[link] => google.fr
)
............
链接与发布说明购买我需要这样的结果
Array
(
[0] => Array
(
[name] => DVD Release
[nfo] => This is description name NFO
[quality] => DVDRip
[links] => Array
(
[0] => Array
(
[id] => 2
[release_id] => 18
[host] => TC
[language] => de
[link] => google.de
[1] => Array
(...........)
[1] => Array (....)
这个表的结构,First Table Called Movie_DReleases:
+-----------------------------------------------+
| id | movie_id | name | nfo | quality |
+-----------------------------------------------+
及其名为Release_Links的表
+---------------------------------------------------+
| id | release_id | host | language | link |
+---------------------------------------------------+