Hi,
Is there a way to add a field to a model which is the result of an SQL
function. My scenario is that I have an image_url field, the thumb of
the image_url is also stored in the same directory with '_thumb'
appended before the index.
ie bradcraig.jpg would become bradcraig_thumb.jpg
Is there a way I can include a SQL function when retrieving the
model?? The SQL to calculate it is below..
SELECT 'images/bradcraig.jpg' AS image_url,
CONCAT(SUBSTRING_INDEX('images/bradcraig.jpg', '.', 1), '_thumb.',
SUBSTRING_INDEX('images/bradcraig.jpg', '.', -1)) AS thumb_url;
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---