$comd_sql = $sql->run("select * from ".MY_PREFIX."_chatArhive where news_id = ? and quote_id = ? order by id ASC",array($_REQUEST['newsID'],$_REQUEST['msgID']));
$comd_sql = $sql->run("select * from ".MY_PREFIX."_chatArhive,".MY_PREFIX."_comments where news_id = ? and quote_id = ? order by id ASC",array($_REQUEST['newsID'],$_REQUEST['msgID']));
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'news_id' in where clause is ambiguous' in /var/www/user/data/www/site.pro/systemDir/classes/DbMysql.php:39 Stack trace: #0 /var/www/user/data/www/site.pro/systemDir/classes/DbMysql.php(39): PDOStatement->execute(Array) #1 /var/www/user/data/www/site.pro/systemDir/classes/ajax.php(2016): DbMysql::run('select * from u...', Array) #2 /var/www/user/data/www/site.pro/systemDir/classes/ajax.php(49): selectHistoryMsg(Object(Ajax), Object(Error_handler)) #3 {main} thrown in /var/www/user/data/www/site.pro/systemDir/classes/DbMysql.php on line 39
Вот ошибка: $comd_sql = $sql->run("(select *,CONVERT(`ho`,CHAR) as `ho`,CONVERT(`mi`,CHAR) as `mi`,CONVERT(`da`,CHAR) as `da` from ".MY_PREFIX."_chatArhive where news_id = ? and quote_id = ?) union (select *,CONVERT(`ho`,CHAR) as `ho`,CONVERT(`mi`,CHAR) as `mi`,CONVERT(`da`,CHAR) as `da` from ".MY_PREFIX."_comments where news_id = ? and quote_id = ?) order by id ASC",array($_REQUEST['newsID'],$_REQUEST['msgID'],$_REQUEST['newsID'],$_REQUEST['msgID']));
".MY_PREFIX."_chatArhive.news_id = ? and ".MY_PREFIX."_chatArhive.quote_id = ?
$comd_sql = $sql->run(
'(SELECT * FROM ' . MY_PREFIX . '_chatArhive WHERE news_id = ? AND quote_id = ?)
UNION
(SELECT * FROM ' . MY_PREFIX . '_comments WHERE news_id = ? AND quote_id = ?)
ORDER BY id ASC',
[$_REQUEST['newsID'], $_REQUEST['msgID'], $_REQUEST['newsID'], $_REQUEST['msgID']]);