ERROR

SQL execution error, -3
Array
(
    [0] => Array
        (
            [file] => /home/data.new/index.php
            [line] => 13
            [function] => run
            [class] => application
            [type] => ->
            [args] => Array
                (
                )

        )

    [1] => Array
        (
            [file] => /home/data.new/framework/application.php
            [line] => 53
            [function] => run_runmode
            [class] => application
            [type] => ->
            [args] => Array
                (
                    [0] => user_profile
                )

        )

    [2] => Array
        (
            [file] => /home/data.new/framework/application.php
            [line] => 109
            [function] => run
            [class] => module_site
            [type] => ->
            [args] => Array
                (
                )

        )

    [3] => Array
        (
            [file] => /home/data.new/modules/SiteSection.php
            [line] => 22
            [function] => run_action
            [class] => module_site
            [type] => ::
            [args] => Array
                (
                    [0] => user_profile
                )

        )

    [4] => Array
        (
            [file] => /home/data.new/mod_Site.php
            [line] => 42
            [function] => run
            [class] => action_user
            [type] => ->
            [args] => Array
                (
                    [0] => module_site Object
                        (
                        )

                )

        )

    [5] => Array
        (
            [file] => /home/data.new/modules/Action/User.php
            [line] => 27
            [function] => _user_profile
            [class] => action_user
            [type] => ->
            [args] => Array
                (
                )

        )

    [6] => Array
        (
            [file] => /home/data.new/modules/Action/User.php
            [line] => 155
            [function] => getall
            [class] => fw_db_interface
            [type] => ->
            [args] => Array
                (
                    [0] => SELECT 
					distinct(c.page_id),
					if (p.account_id = ?, 'owner', 'contributor') as role,
					relationship_title,
					page_title, 
					page_link, 
					
					account_domain,
					if (p.page_photo_choice = 'C',
						(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id = p.album_photo_id LIMIT 1),
						if (p.page_photo_choice = 'R',
							( SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY RAND() LIMIT 1),
							if (p.page_photo_choice = 'M',
							(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id DESC LIMIT 1),
							(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id ASC LIMIT 1)							
							)						
						)					
					) as route_image,
					p.account_id as route_owner,
					(SELECT count(*) from m_wejourn__CONTRIBUTOR c1 where c1.account_id = ? and c1.page_id = c.page_id AND c1.contributor_is_approved IS NOT NULL) as is_member
				FROM 
					m_wejourn__CONTRIBUTOR c
						LEFT JOIN m_wejourn__RELATIONSHIP r on c.relationship_id = r.relationship_id
						LEFT JOIN m_wejourn__PAGE p on c.page_id = p.page_id
						LEFT JOIN m_wejourn__ACCOUNT a on p.account_id = a.account_id 
				WHERE
				 	account_is_inactive = 0 AND 
					c.contributor_is_approved IS NOT NULL AND 
					c.account_id = ? AND
					page_title <> 'user_photos' AND
					(page_restrict_view = 0 OR 
					(SELECT count(*) from m_wejourn__CONTRIBUTOR c1 where c1.account_id = ? and c1.page_id = c.page_id and c1.contributor_is_approved IS NOT NULL)
		 			> 0)
				ORDER BY 
					p.account_id = 1573 DESC, page_title ASC
				
                    [1] => Array
                        (
                            [0] => 1573
                            [1] => 
                            [2] => 1573
                            [3] => 
                        )

                )

        )

    [7] => Array
        (
            [file] => /home/data.new/framework/fw_DB.php
            [line] => 244
            [function] => execute
            [class] => fw_db_interface
            [type] => ->
            [args] => Array
                (
                    [0] => 7
                    [1] => Array
                        (
                            [0] => 1573
                            [1] => 
                            [2] => 1573
                            [3] => 
                        )

                )

        )

    [8] => Array
        (
            [file] => /home/data.new/framework/fw_DB.php
            [line] => 204
            [function] => _raiseerror
            [class] => fw_db_interface
            [type] => ->
            [args] => Array
                (
                    [0] => -3
                )

        )

    [9] => Array
        (
            [file] => /home/data.new/framework/fw_DB.php
            [line] => 441
            [function] => fw_db_error
            [class] => fw_db_error
            [type] => ->
            [args] => Array
                (
                    [0] => 
                    [1] => -3
                    [2] => 
                    [3] => 
                    [4] => SELECT 
					distinct(c.page_id),
					if (p.account_id = 1573, 'owner', 'contributor') as role,
					relationship_title,
					page_title, 
					page_link, 
					
					account_domain,
					if (p.page_photo_choice = 'C',
						(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id = p.album_photo_id LIMIT 1),
						if (p.page_photo_choice = 'R',
							( SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY RAND() LIMIT 1),
							if (p.page_photo_choice = 'M',
							(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id DESC LIMIT 1),
							(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id ASC LIMIT 1)							
							)						
						)					
					) as route_image,
					p.account_id as route_owner,
					(SELECT count(*) from m_wejourn__CONTRIBUTOR c1 where c1.account_id = NULL and c1.page_id = c.page_id AND c1.contributor_is_approved IS NOT NULL) as is_member
				FROM 
					m_wejourn__CONTRIBUTOR c
						LEFT JOIN m_wejourn__RELATIONSHIP r on c.relationship_id = r.relationship_id
						LEFT JOIN m_wejourn__PAGE p on c.page_id = p.page_id
						LEFT JOIN m_wejourn__ACCOUNT a on p.account_id = a.account_id 
				WHERE
				 	account_is_inactive = 0 AND 
					c.contributor_is_approved IS NOT NULL AND 
					c.account_id = 1573 AND
					page_title <> 'user_photos' AND
					(page_restrict_view = 0 OR 
					(SELECT count(*) from m_wejourn__CONTRIBUTOR c1 where c1.account_id = NULL and c1.page_id = c.page_id and c1.contributor_is_approved IS NOT NULL)
		 			> 0)
				ORDER BY 
					p.account_id = 1573 DESC, page_title ASC
				
                )

        )

    [10] => Array
        (
            [file] => /home/data.new/framework/fw_DB.php
            [line] => 896
            [function] => pear_error
            [class] => fw_db_error
            [type] => ->
            [args] => Array
                (
                    [0] => SQL execution error
                    [1] => -3
                    [2] => 
                    [3] => 
                    [4] => Got error 28 from storage engine [nativecode=1030]: SELECT 
					distinct(c.page_id),
					if (p.account_id = 1573, 'owner', 'contributor') as role,
					relationship_title,
					page_title, 
					page_link, 
					
					account_domain,
					if (p.page_photo_choice = 'C',
						(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id = p.album_photo_id LIMIT 1),
						if (p.page_photo_choice = 'R',
							( SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY RAND() LIMIT 1),
							if (p.page_photo_choice = 'M',
							(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id DESC LIMIT 1),
							(SELECT IF (media_type = 2, videoEggPath, CONCAT('/img/photos/', ph.creator_account_id, '/', ph.photo_file_name, 't.jpg')) as image
			FROM m_wejourn__ALBUM_PHOTO ap LEFT JOIN m_wejourn__PHOTO ph on ap.photo_id = ph.photo_id LEFT JOIN m_wejourn__ALBUM ab on ap.album_id = ab.album_id
			WHERE ab.page_id = p.page_id ORDER BY ap.album_photo_id ASC LIMIT 1)							
							)						
						)					
					) as route_image,
					p.account_id as route_owner,
					(SELECT count(*) from m_wejourn__CONTRIBUTOR c1 where c1.account_id = NULL and c1.page_id = c.page_id AND c1.contributor_is_approved IS NOT NULL) as is_member
				FROM 
					m_wejourn__CONTRIBUTOR c
						LEFT JOIN m_wejourn__RELATIONSHIP r on c.relationship_id = r.relationship_id
						LEFT JOIN m_wejourn__PAGE p on c.page_id = p.page_id
						LEFT JOIN m_wejourn__ACCOUNT a on p.account_id = a.account_id 
				WHERE
				 	account_is_inactive = 0 AND 
					c.contributor_is_approved IS NOT NULL AND 
					c.account_id = 1573 AND
					page_title <> 'user_photos' AND
					(page_restrict_view = 0 OR 
					(SELECT count(*) from m_wejourn__CONTRIBUTOR c1 where c1.account_id = NULL and c1.page_id = c.page_id and c1.contributor_is_approved IS NOT NULL)
		 			> 0)
				ORDER BY 
					p.account_id = 1573 DESC, page_title ASC
				
                )

        )

)