Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. SELECT tab.* FROM ((SELECT 0 as `isgal`, tf.`fileId` as `id`, tf.`galleryId` as `parentId`, tf.`name`, tf.`description`, tf.`filesize` as `size`, tf.`created`, tf.`filename`, tf.`filetype` as `type`, tf.`user` as `creator`, tf.`author`, tf.`hits`, tf.`lastDownload`, tf.`votes`, tf.`points`, tf.`path`, tf.`reference_url`, tf.`is_reference`, tf.`hash`, tf.`search_data`, tf.`lastModif` as `lastModif`, tf.`lastModifUser` as `last_user`, tf.`lockedby`, tf.`comment`, tf.`deleteAfter`, tf.`maxhits`, tf.`archiveId`, '' as `visible`, '' as `public`, tf.`fileId`, tf.`galleryId`, tf.`filesize`, tf.`filetype`, tf.`user`, tf.`lastModifUser`, 0 as `icon_fileId`, '' as `files` FROM `tiki_files` as tf WHERE tf.`archiveId`=0 AND tf.`galleryId`=? ) UNION (SELECT 1 as `isgal`, tfg.`galleryId` as `id`, tfg.`parentId`, tfg.`name`, tfg.`description`, 0 as `size`, tfg.`created`, tfg.`name` as `filename`, tfg.`type`, tfg.`user` as `creator`, '' as `author`, tfg.`hits`, 0 as `lastDownload`, tfg.`votes`, tfg.`points`, '' as `path`, '' as `reference_url`, '' as `is_reference`, '' as `hash`, tfg.`name` as `search_data`, tfg.`lastModif` as `lastModif`, '' as `last_user`, '' as `lockedby`, '' as `comment`, '' as `deleteAfter`, '' as `maxhits`, 0 as `archiveId`, tfg.`visible`, tfg.`public`, tfg.`galleryId` as `fileId`, tfg.`parentId` as `galleryId`, 0 as `filesize`, tfg.`type` as `filetype`, tfg.`user`, '' as `lastModifUser`, `icon_fileId`, count(distinct tfc.`fileId`) as `files` FROM `tiki_file_galleries` as tfg LEFT JOIN `tiki_files` tfc ON (tfg.`galleryId` = tfc.`galleryId`) WHERE 1=1 AND tfg.`parentId`=? GROUP BY tfg.`galleryId`)) as tab ORDER BY `isgal` desc, tab.`created` desc ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement