我越来越:致命错误:未捕获异常“PDOException”,消息为“SQLSTATE[42000]:语法错误或访问冲突:1064 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在第 1 行“LIMIT 1”附近使用的正确语法我正在尝试将一些代码从 MySQL 5.6 升级到 5.7,但我不知道如何重写它? public function getPlayerInfo($uid){ $this->session->newQuery(); $sqlSelect = "SELECT COUNT(*) AS total, login, gameIP, homeIP, gamePass, email FROM users WHERE id = $uid LIMIT 1"; $data = $this->pdo->query($sqlSelect)->fetch(PDO::FETCH_OBJ); if($data->total == 0){ exit(); }为了澄清它的作用,它应该返回相关的玩家数据,例如,在这个文件的下面,我有:if($doomStats['DOOM']['clanID'] == 0){ $doomedBy = '<a href="profile?id='.$doomStats['DOOM']['creatorID'].'">'.self::getPlayerInfo($doomStats['DOOM']['creatorID'])->login.'</a>'; } else { $clan = new Clan(); $clanInfo = $clan->getClanInfo($doomStats['DOOM']['clanID']); $doomedBy = '<a href="clan?id="'.$doomStats['DOOM']['clanID'].'">'.$clanInfo->name.'</a>'; $doomedBy .= ' <span class="small nomargin">(Released by <a href="profile?id='.$doomStats['DOOM']['creatorID'].'">'.self::getPlayerInfo($doomStats['DOOM']['creatorID'])->login.'</a>)</span>'; }我希望这能澄清。
添加回答
举报
0/150
提交
取消