本文介绍了如何修复“语法”?问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您的SQL语法有错误;查看与您的MariaDB服务器版本对应的手册,以便在''信息'附近使用正确的语法WHERE'id'='SELECT`id` FROM`count` WHERE`username` ='stswil'在第1行You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''information' WHERE 'id' = 'SELECT `id` FROM `account` WHERE `username` ='stswil' at line 1<?phpinclude "connection.php";$username =$_POST['username'];$password =$_POST['password'];$query = " SELECT `username`, `password` FROM `account` WHERE `username` = '$username' AND `password` = '$password' ";$id = "SELECT `id` FROM `account` WHERE `username` ='$username' ";$IDquery = " SELECT 'id' FROM 'information' WHERE 'id' = '$id' ";$IDresults = mysqli_query($conn, $IDquery) or die(mysqli_error($conn));$result="";$results = mysqli_query($conn, $query) or die(mysqli_error($conn));if(mysqli_num_rows($results)!=1){$result="Non-Vaild user";}else if(mysqli_num_rows($IDresults)!=1){header( 'Location: https://xesusanproject.000webhostapp.com/information.html' ) ;}else{header( 'Location: https://xesusanproject.000webhostapp.com/information.php' ) ;}?><!DOCTYPE html><head><link rel="apple-touch-icon" sizes="180x180" href="images/favicons/apple-touch-icon.png"><link rel="icon" type="image/png" href="images/favicons/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="images/favicons/favicon-16x16.png" sizes="16x16"><link rel="manifest" href="manifest.json"><link rel="mask-icon" href="images/favicons/safari-pinned-tab.svg" color="#741372"><meta name="apple-mobile-web-app-title" content="Medical Database"><meta name="application-name" content="Medical Database"><meta name="theme-color" content="#741372"><link rel="stylesheet" href="style/main.css" type="text/css"><title>Sucess-Login</title></head><body><menu><ul><li><a href="logout.php">Log Out</a></li></ul></menu><span style="margin:0px 0px 0px 10px"><?php echo $result ?></span></body></html> 更新 新错误:你有错误你的SQL语法;检查与您的MariaDB服务器版本对应的手册,以便在第1行'stswilliams15''附近使用正确的语法 更新UpdateNew error : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'stswilliams15' '' at line 1from updating$IDquery = " SELECT `id` FROM `information` WHERE `id` = '$id' "; 想从帐户获取身份证明(此人只是使用该信息登录)。然后在信息中找到匹配的id,以查看信息表中是否已存在数据。如果信息表中没有匹配的ID,那么我想转到https://xesusanproject.000webhostapp.com/information.html添加数据。如果有匹配的ID,那么我希望显示数据 我尝试过的事情: b $ b检查vairables,要求现实生活中的人Wanted to get the id from account (The person just logged in with that information). Then find the matching id in the information to see if there data already in information table. If there no matching id in the information table then I want to go to "https://xesusanproject.000webhostapp.com/information.html" to added the data. If there is matching id then I want the data to be shownWhat I have tried:checking vairables, asking for people in real life推荐答案用户名 =username = _POST [' username'];_POST['username'];密码 =password = 这篇关于如何修复“语法”?问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!