-------- DB ERROR ERRNO: 1045 --------

 ERROR: Access denied for user 'cancer'@'localhost' (using password: NO)

 LINE: 137

 FILE:/var/www/joga-joga.pl/admin/includes/functions/db.func.php

 QUERY:

 
		SELECT
			SQL_CALC_FOUND_ROWS w.*,
			(CASE 1 WHEN w.url_title IS NOT NULL THEN CONCAT("", w.url_title) ELSE "" END) AS url_title,
			UNIX_TIMESTAMP(w.start_date) as new_start_date, UNIX_TIMESTAMP(w.end_date) as new_end_date,
			(CASE 1 WHEN TIME(w.start_date) = "00:00:00" THEN "" ELSE UNIX_TIMESTAMP(w.start_date) END) AS start_time,
			(CASE 1 WHEN TIME(w.end_date) = "00:00:00" THEN "" ELSE UNIX_TIMESTAMP(w.end_date) END) AS end_time,
			CONCAT(p.sciezka, "/", p.nazwa) as obrazek,
			(CASE 1
				WHEN DATE(l.insert_time) <= "2010-11-06" AND l.filename IS NOT NULL
					THEN CONCAT("joga", "_n", w.event_ID, "_", l.filename)
				WHEN DATE(l.insert_time) > "2010-11-06" AND l.filename IS NOT NULL
					THEN CONCAT("joga", w.event_ID, "_min_", l.filename)
				ELSE NULL END
			) as logo,
			t.nazwa as eventType,
			o.nazwa as organizator,
			(CASE 1 WHEN n.imie IS NOT NULL THEN CONCAT(n.imie, "  ") ELSE "" END) AS imie, n.nazwisko,
			UNIX_TIMESTAMP(w.insert_time) AS rssPubDate
		FROM
										  joga_event w
				LEFT OUTER JOIN joga_event_type AS t ON (w.eventType_ID = t.eventType_ID)
				LEFT OUTER JOIN joga_event_organizatorzy AS o ON (w.organizator_ID = o.organizator_ID)
				LEFT OUTER JOIN joga_sklep_zamowienia AS z ON (w.event_ID = z.wpis_ID AND z.wpis_type LIKE "event")
			LEFT OUTER JOIN joga_autorzy AS n ON (w.autor_ID = n.autor_ID)
			LEFT OUTER JOIN joga_pliki AS p ON (w.obiekt_ID = p.obiekt_ID)
			LEFT OUTER JOIN joga_event_zdjecia AS l ON (w.event_ID = l.event_ID AND l.logo = 1)
		WHERE
			w.lang LIKE "pl" AND
			(CASE 1 WHEN w.eventType_ID IS NOT NULL THEN t.lang LIKE "pl" ELSE true END) AND
			(CASE 1 WHEN w.organizator_ID IS NOT NULL THEN o.lang LIKE "pl" ELSE true END) AND
			(CASE 1 WHEN w.obiekt_ID > 0 THEN p.funkcja = 3 ELSE true END) AND
			w.status = 1 AND
			
			(
				CASE 1
					WHEN w.end_date IS NOT NULL AND w.end_date != "0000-00-00 00:00:00" AND w.start_date IS NOT NULL AND w.start_date != "0000-00-00 00:00:00"
					THEN (w.start_date >= now() OR w.end_date > now())
					WHEN (w.end_date IS NULL OR w.end_date = "0000-00-00 00:00:00") AND (w.start_date IS NOT NULL AND w.start_date != "0000-00-00 00:00:00")
					THEN w.start_date >= now()
					ELSE true
				END
			) AND 
			(CASE 1
				WHEN w.is_public = 1 AND z.start_date IS NOT NULL AND z.end_date IS NOT NULL AND z.start_date != "0000-00-00 00:00:00"  AND z.end_date != "0000-00-00 00:00:00"
				THEN (z.start_date <= now() AND z.end_date > now() )
				ELSE true
				END
			)
		GROUP BY w.event_ID
		ORDER BY w.start_date ASC
		LIMIT 0,10
	

-------- DB ERROR END --------