SELECT DISTINCT a.*, p.name as parent, p.id as parentid, c.name as cat, c.id as catid, u.username as user FROM #__adsmanager_ads as a LEFT JOIN #__adsmanager_adcat as adcat ON adcat.adid = a.id LEFT JOIN #__users as u ON a.userid = u.id LEFT JOIN #__adsmanager_categories as c ON adcat.catid = c.id LEFT JOIN #__adsmanager_categories as p ON c.parent = p.id WHERE a.id=456042 and adcat.catid = 3 and c.published LIMIT 1
$row->ad_text
Цена: $row->ad_price