PHP 5.6 + Apache2 + mySQL 8.0.32
phpBB 3.0.14 (ppkBB3cker free v.2.5 Ревизия: 20210430 Обновление: 54.1)
Обращение к БД:
$sql = "SELECT
u.user_id, u.user_uploaded, u.user_uploaded_self, u.user_downloaded, u.user_permissions, u.user_bonus, u.user_type, u.user_tracker_data,
tr.id, tr.seeders, tr.leechers, tr.times_completed, tr.added, tr.free, tr.size, tr.upload, tr.req_ratio, tr.req_upload, tr.poster_id, tr.unreg, tr.tsl_speed, tr.lastslspeed,
t.forb"
. ($config['ppkbb_tcenable_snatchstat'] ? ", s.finished, s.bonus_count, s.id s_id" : '') . "
FROM " . USERS_TABLE . " u
LEFT JOIN " . TRACKER_TORRENTS_TABLE . " tr ON (tr.info_hash='{$info_hash}')
LEFT JOIN " . TOPICS_TABLE . " t ON (t.topic_id=tr.topic_id)"
. ($config['ppkbb_tcenable_snatchstat'] ? " LEFT JOIN " . TRACKER_SNATCHED_TABLE . " s ON (tr.id=s.torrent AND u.user_id=s.userid AND s.guests='0'" : '')
. " WHERE u.user_passkey='{$passkey}' AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") LIMIT 1";
Ошибка:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE u.user_passkey='qbkv2qm32k6dw2ey1g4brg122t8oxyhf' AND u.user_type IN (0, 3' at line 7 [1064]
SELECT
u.user_id, u.user_uploaded, u.user_uploaded_self, u.user_downloaded, u.user_permissions, u.user_bonus, u.user_type, u.user_tracker_data,
tr.id, tr.seeders, tr.leechers, tr.times_completed, tr.added, tr.free, tr.size, tr.upload, tr.req_ratio, tr.req_upload, tr.poster_id, tr.unreg, tr.tsl_speed, tr.lastslspeed,
t.forb, s.finished, s.bonus_count, s.id s_id
FROM tracker_users u
LEFT JOIN tracker_tracker_torrents tr ON (tr.info_hash='75fe03fe4758e675255d49b15dff25316aee45d2')
LEFT JOIN tracker_topics t ON (t.topic_id=tr.topic_id) LEFT JOIN tracker_tracker_snatched s ON (tr.id=s.torrent AND u.user_id=s.userid AND s.guests='0' WHERE u.user_passkey='qbkv2qm32k6xw2ey1g4brg122t8oxyhf' AND u.user_type IN (0, 3) LIMIT 1
Где подправить код обращения, что-бы ошибки не было?