Я хочу конкат-файл. Прежде всего, это мои записи;
tb_barang;
+-----------+-----------+------+ | ID_BARANG | VESSEL | VOY | +-----------+-----------+------+ | 1 | TMS_GLORY | 0000 | | 2 | TMS_GLORY | 0000 | +-----------+-----------+------+
tb_damage_per_coil;
+-----------+-----------+------------+ | ID_DAMAGE | ID_BARANG | KETERANGAN | +-----------+-----------+------------+ | 35 | 1 | DAMAGE 1 | | 36 | 2 | DAMAGE 2 | +-----------+-----------+------------+ 2 rows in set (0.00 sec)
tb_file_image
+----------+-----------+----------------------------------------------------------------------------------------------------+ | ID_IMAGE | ID_DAMAGE | FILE_PATH | +----------+-----------+----------------------------------------------------------------------------------------------------+ | 35 | 35 | D:/XAMPP/htdocs/develop_tsurumaru/assets/iwwi_file/DO_FOLDER/Damage_Report/0510-31-07-2016/35.jpg | | 36 | 35 | D:/XAMPP/htdocs/develop_tsurumaru/assets/iwwi_file/DO_FOLDER/Damage_Report/0510-31-07-2016/351.jpg | | 37 | 36 | D:/XAMPP/htdocs/develop_tsurumaru/assets/iwwi_file/DO_FOLDER/Damage_Report/0520-31-07-2016/36.jpg | | 38 | 36 | D:/XAMPP/htdocs/develop_tsurumaru/assets/iwwi_file/DO_FOLDER/Damage_Report/0520-31-07-2016/361.jpg | +----------+-----------+----------------------------------------------------------------------------------------------------+ 4 rows in set (0.00 sec) [1]: http://img.ruphp.com/php/FoAKE.jpg
Моя цель: я хочу, чтобы путь файла к файлу был записан в одну запись. Мой запрос:
SELECT a.ID_BARANG, b.ID_DAMAGE, a.VESSEL, a.VOY, b.KETERANGAN FROM tb_barang a INNER JOIN tb_damage_per_coil b ON a.ID_BARANG = b.ID_BARANG WHERE a.VESSEL LIKE "%TMS%" AND a.VOY LIKE "%000%" +-----------+-----------+-----------+------+------------+ | ID_BARANG | ID_DAMAGE | VESSEL | VOY | KETERANGAN | +-----------+-----------+-----------+------+------------+ | 1 | 35 | TMS_GLORY | 0000 | DAMAGE 1 | | 2 | 36 | TMS_GLORY | 0000 | DAMAGE 2 | +-----------+-----------+-----------+------+------------+ 2 rows in set (0.00 sec)
Мне это нужно
+-----------+-----------+-----------+------+------------+---------------+ | ID_BARANG | ID_DAMAGE | VESSEL | VOY | KETERANGAN | FILE_PATH | +-----------+-----------+-----------+------+------------+---------------+ | 1 | 35 | TMS_GLORY | 0000 | DAMAGE 1 | FILE1, FILE 2 | | 2 | 36 | TMS_GLORY | 0000 | DAMAGE 2 | FILE1, FILE 2 | +-----------+-----------+-----------+------+------------+---------------+
Что я должен использовать в своем запросе?