|
|
We're sorry, but the system experienced an unrecoverable error. Please try again later.
Script:
Query: SELECT c.id, c.parent, c.catname, c.description, (SELECT COUNT(*)
FROM ppi_cats_tree t
JOIN ppi_photos p ON t.catid=p.id
WHERE t.parentid=c.id) photos, /* 0 - 4 */
(SELECT COUNT(*)
FROM ppi_cats_tree t
JOIN ppi_photos p ON t.catid=p.cat
JOIN ppi_comments com ON p.id=com.photo
WHERE t.parentid=c.id) posts, c.private, p.userid, p.user, p.bigimage, /* 5 - 9 */
p.cat, p.storecat, p.approved, p.width, p.height, /* 10 - 14 */
p2.bigimage, p2.cat, p2.storecat, p2.userid, p2.user, /* 15 - 19 */
case when(CoalEsce(c.thumbnail,0)=0) then p2.id else c.thumbnail end as thumbnail,
c.catname1, c.commonname, p2.width, p2.height, /* 20 - 24 */
p.date as lastphodate, com.date as lastcomdate, c.catdepth, c.region, c.desc1, c.desc2, c.desc3,
(SELECT pp.id FROM ppi_photos pp WHERE pp.cat=c.id AND pp.priority=1 LIMIT 1) priocat,
(SELECT pp.id FROM ppi_photos pp WHERE pp.cat=c.id AND pp.priority=-1 LIMIT 1) autopriocat,
(SELECT pp.id FROM ppi_photos pp WHERE pp.cat=c.id LIMIT 1) hasphoto,
c.taxon, p2.md5box100,
(SELECT g.id FROM ppi_photos p
JOIN ppi_geolocation g on g.photo=p.id AND g.state=1
WHERE p.cat=c.id LIMIT 1) onmap, c.detdesc,
au.id authorid, au.name authorname, c.ayear, c.aparent
FROM ppi_categories c
LEFT JOIN ppi_class_author au ON au.id=c.authorid
LEFT JOIN ppi_photos p ON p.id=c.lastphoto
LEFT JOIN ppi_comments com ON com.id=c.lastpost
LEFT JOIN ppi_photos p2 ON p2.id=
(CASE when(CoalEsce(c.thumbnail,0)=0) then (SELECT p.id
FROM ppi_cats_tree t
JOIN ppi_photos p ON t.catid=p.cat
WHERE t.parentid=c.id
ORDER BY p.id DESC
LIMIT 1) else c.thumbnail end) WHERE (c.parent=597) AND c.subfamily_id= AND c.id <> 500 AND (
(EXISTS(SELECT id FROM ppi_photos where cat=c.id LIMIT 1))
OR (EXISTS(SELECT id FROM ppi_categories where parent=c.id LIMIT 1))
OR (EXISTS(SELECT ac.id FROM ppi_class_alt ac WHERE ac.classid=c.id LIMIT 1))
OR (EXISTS(SELECT rc.id FROM ppi_regioncat rc WHERE rc.catid=c.id))
OR c.region <> ''
OR c.description <> ''
OR c.desc1 <> ''
OR EXISTS(SELECT r.id FROM ppi_checklistref r WHERE r.item_id=c.id)
) ORDER BY c.catname, c.catname1, c.id
Result: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND c.id <> 500 AND (
(EXISTS(SELECT id FROM ppi_photos where' at line 33
Database handle: Resource id #7
|
|
 |
|
2005-2023 (c) Macroid.ru - Классификатор-определить объектов природы
|
|
|
|
|