How do I get the file name for a channel image field {thumbnail} that is in a channel using sql query? When I look in SQL manager the image file appears like this in exp_channel_data field_id_6:
https://ellislab.com/asset/images/team-photo/13.jpgrather than 13.jpg
the exp_channel_data channel_id is 3
Do I need to do a JOIN with exp_files - file_name ? ( I only want images from that channel 3 though).
I’m trying to grab the 4 last images posted to a channel - 1 per author.
this doesn’t seem to work:
{exp:query sql="SELECT file_name FROM exp_files
WHERE exp_channel_data.channel_id='3' LIMIT 4"}
{file_name} alt=
{/exp:query}[Mod Edit: Moved to the Development and Programming forum]
You might want to look at this thread: Remove the filedir_1 from the start of the rendered sql call
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.