View Revisions: Issue #766

Summary 0000766: Ошибка в запросе
Revision 2014-12-22 16:39 by barry
Description http://macroid.ru/showcat.php?action=last_edit&cat=84547
We're sorry, but the system experienced an unrecoverable error. Please try again later.

Script:

Query: SELECT p.id, c.catname, c.catname1, c.commonname, p.bigimage, p.userid, u.username AS user, p.cat, p.approved, p.gender, p.reliability, p.priority, p.party, p.stage, p.date, p.eddatetime, p.eduserid, eu.username AS edusername, c1.id c1id, c2.id c2id, c3.id c3id, p.title, p.reliability_userid, p.reliabilitydatetime, ru.username AS reliabilityusername, p.medsize, p.date_time, p.location, (select count(*) from ppi_comments cn1 where cn1.photo = p.id) as comments, c1.catname as c1catname, c2.catname as c2catname, c3.catname as c3catname, p.md5100, p.md5150, p.md5200, p.md5300, p.md5400, p.md5600, p.md5box100, p.md5box200 FROM (SELECT p.id FROM ppi_cats_tree t JOIN ppi_photos p ON p.cat=t.catid JOIN ppi_categories c ON c.id=p.cat WHERE (t.parentid=84547) ORDER BY eddatetime desc, date desc, id desc LIMIT 40 OFFSET 0 ) AS p1 JOIN ppi_photos p ON p.id=p1.id LEFT JOIN ppi_categories c ON c.id = p.cat LEFT JOIN ppi_categories c1 ON c1.id = c.parent LEFT JOIN ppi_categories c2 ON c2.id = c1.parent LEFT JOIN ppi_categories c3 ON c3.id = c2.parent LEFT JOIN ppi_users u ON u.userid = p.userid LEFT JOIN ppi_users eu ON eu.userid = p.eduserid LEFT JOIN ppi_users ru ON ru.userid = p.reliability_userid ORDER BY eddatetime desc, date desc, id desc

Result: Column 'eddatetime' in order clause is ambiguous

Database handle: Resource id # 6
Revision 2014-12-22 16:39 by barry
Description http://macroid.ru/showcat.php?action=last_edit&cat=84547
We're sorry, but the system experienced an unrecoverable error. Please try again later.

Script:

Query: SELECT p.id, c.catname, c.catname1, c.commonname, p.bigimage, p.userid, u.username AS user, p.cat, p.approved, p.gender, p.reliability, p.priority, p.party, p.stage, p.date, p.eddatetime, p.eduserid, eu.username AS edusername, c1.id c1id, c2.id c2id, c3.id c3id, p.title, p.reliability_userid, p.reliabilitydatetime, ru.username AS reliabilityusername, p.medsize, p.date_time, p.location, (select count(*) from ppi_comments cn1 where cn1.photo = p.id) as comments, c1.catname as c1catname, c2.catname as c2catname, c3.catname as c3catname, p.md5100, p.md5150, p.md5200, p.md5300, p.md5400, p.md5600, p.md5box100, p.md5box200 FROM (SELECT p.id FROM ppi_cats_tree t JOIN ppi_photos p ON p.cat=t.catid JOIN ppi_categories c ON c.id=p.cat WHERE (t.parentid=84547) ORDER BY eddatetime desc, date desc, id desc LIMIT 40 OFFSET 0 ) AS p1 JOIN ppi_photos p ON p.id=p1.id LEFT JOIN ppi_categories c ON c.id = p.cat LEFT JOIN ppi_categories c1 ON c1.id = c.parent LEFT JOIN ppi_categories c2 ON c2.id = c1.parent LEFT JOIN ppi_categories c3 ON c3.id = c2.parent LEFT JOIN ppi_users u ON u.userid = p.userid LEFT JOIN ppi_users eu ON eu.userid = p.eduserid LEFT JOIN ppi_users ru ON ru.userid = p.reliability_userid ORDER BY eddatetime desc, date desc, id desc

Result: Column 'eddatetime' in order clause is ambiguous

Database handle: Resource id 0000006