Hi,As i need to get only attachment of particular tickets directly from database.Please let me know is it possible. If possible then please provide your advice to get through mysql query.Thanks in advance......

This does not appear to be a suggestion of feedback.  Moving thread to Mods and Customizations.

8 days later

I think this is what you are wanting:

SELECT * FROM ost_file f LEFT JOIN ost_attachment a ON (a.file_id = f.id) LEFT JOIN ost_file_chunk c ON (a.file_id = c.file_id)

3 years later

This query can serve:

SELECT t.number, f.name
FROM ost_ticket t
JOIN ost_thread th ON (t.ticket_id = th.object_id)
LEFT JOIN ost_thread_entry e ON e.id =
(SELECT id
FROM ost_thread_entry
WHERE thread_id=th.id
AND TYPE='M'
LIMIT 1)
JOIN ost_attachment a ON ( e.id = a.object_id)
JOIN ost_file f ON (a.file_id = f.id)
ORDER BY t.number

Thread is almost four years old.
Killing zombie thread with a head shot.

Write a Reply...