我越來(lái)越:致命錯(cuò)誤:未捕獲異?!癙DOException”,消息為“SQLSTATE[42000]:語(yǔ)法錯(cuò)誤或訪問(wèn)沖突:1064 您的 SQL 語(yǔ)法有錯(cuò)誤;檢查與您的 MySQL 服務(wù)器版本相對(duì)應(yīng)的手冊(cè),了解在第 1 行“LIMIT 1”附近使用的正確語(yǔ)法我正在嘗試將一些代碼從 MySQL 5.6 升級(jí)到 5.7,但我不知道如何重寫(xiě)它? 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(); }為了澄清它的作用,它應(yīng)該返回相關(guān)的玩家數(shù)據(jù),例如,在這個(gè)文件的下面,我有: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>'; }我希望這能澄清。
- 1 回答
- 0 關(guān)注
- 117 瀏覽
添加回答
舉報(bào)
0/150
提交
取消