SELECT Count(*) As Expr1 FROM ((koul8_contentAS c LEFTJOINkoul8_usersAS u ON u.id=c.created_by) LEFTJOINkoul8_contentAS ar ON c.parentid=ar.id) LEFTJOINkoul8_usersAS aru ON aru.id=ar.created_by WHERE (c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=12503 AND c.state = 1

SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions
FROMkoul8_banners as a
LEFTJOINkoul8_banner_clientsAS cl ON cl.id = a.cid
WHERE a.state=1 AND (CURRENT_TIMESTAMP() >= a.publish_up OR a.publish_up = '0000-00-00 00:00:00') AND (CURRENT_TIMESTAMP() <= a.publish_down OR a.publish_down = '0000-00-00 00:00:00') AND (a.imptotal = 0 OR a.impmade <= a.imptotal) AND a.catid IN (13)
ORDERBY a.sticky DESC,a.ordering

SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions
FROMkoul8_banners as a
LEFTJOINkoul8_banner_clientsAS cl ON cl.id = a.cid
WHERE a.state=1 AND (CURRENT_TIMESTAMP() >= a.publish_up OR a.publish_up = '0000-00-00 00:00:00') AND (CURRENT_TIMESTAMP() <= a.publish_down OR a.publish_down = '0000-00-00 00:00:00') AND (a.imptotal = 0 OR a.impmade <= a.imptotal) AND a.catid IN (13)
ORDERBY a.sticky DESC,a.ordering LIMIT 0, 20

2 × SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions FROMkoul8_banners as a LEFTJOINkoul8_banner_clientsAS cl ON cl.id = a.cid