Q=SELECT news_event.ID as ID ,media.file as image ,media.highlight as highlight ,SUBSTRING_INDEX( media.imagesize , 'X', 1 ) AS width, SUBSTRING_INDEX(SUBSTRING_INDEX( media.imagesize , 'X', 2 ),'X',-1) AS height FROM vinnico_stories as news_event INNER JOIN vinnico_media as media INNER JOIN vinnico_media_catassoc as assoc_media ON ( assoc_media.TABLE_parent = 'vinnico_stories' AND assoc_media.ID_media=media.ID AND assoc_media.FIELD_parent = 'image_stories' AND (assoc_media.ID_parent = news_event.ID )) WHERE news_event.ID='108' AND news_event.ID_status=1 ORDER BY media.order ASC,media.date ASC,media.highlight DESC