简体   繁体   English

什么是 SQL 语法; 检查与您的 MariaDB 服务器版本相对应的手册?

[英]what is for SQL syntax; check the manual that corresponds to your MariaDB server version?

the code is totally true but during execute i face error代码完全正确,但在执行过程中我遇到错误

whats wrong with this code ... of course im beginner coder guys but help me please这段代码有什么问题......当然我是初学者编码人员,但请帮助我

THE ERROR IS :错误是:

You have an error in your SQL syntax;您的 SQL 语法有错误; check the manual that corresponds to your MariaDB server version for the right syntax to use near '52, v@test.com)VALUES ('niki','52','v@test.com')' at line 1检查与您的 MariaDB 服务器版本相对应的手册,在第 1 行的 '52, v@test.com)VALUES ('niki','52','v@test.com')' 附近使用正确的语法

THE CODE IS :代码是:

<?php 
if(isset($_POST['submit'])){
   $Name= $_POST ['Name'];
   $Password = $_POST [ 'Password'];
  $Email= $_POST [ 'Email'];
   $connection = mysqli_connect('127.0.0.1','root','','loginapp');
   if($connection){
      echo "Hi Dude , we are conneted";
   }else{
      die('DataBase is Failed');
   }
   $query = "INSERT INTO `users`($Name , $Password, $Email)" ; 
   $query .= "VALUES ('$Name','$Password','$Email')";
  $result = mysqli_query($connection , $query);
  if (!$result){
     die('Query FAILED'. mysqli_error($connection));
  }
}else { 
   echo "Record Create"; 
}

You must use column names in place of variables in the insert statement.您必须在插入语句中使用列名代替变量。
Insted of插入的
$query = "INSERT INTO users ($Name , $Password, $Email)" ; $query .= "VALUES ('$Name','$Password','$Email')"; $query = "INSERT INTO用户($Name , $Password, $Email)" ; $query .= "VALUES ('$Name','$Password','$Email')"; ($Name , $Password, $Email)" ; $query .= "VALUES ('$Name','$Password','$Email')";

Use something like this使用这样的东西

$query = "INSERT INTO users (Name , Password, Email)" ; $query .= "VALUES ('$Name','$Password','$Email')"; $query = "INSERT INTO用户(Name , Password, Email)" ; $query .= "VALUES ('$Name','$Password','$Email')"; (Name , Password, Email)" ; $query .= "VALUES ('$Name','$Password','$Email')";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL 语法错误; 检查与您的 MariaDB 服务器版本相对应的手册以获取正确的语法 - error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax 您的SQL语法有错误;查看与MariaDB服务器版本对应的手册,以获取正确的语法 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use 您的SQL语法有误; 请查看与您的MariaDB服务器版本相对应的手册以获取正确的语法” - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax" SQL 语法错误; 检查与您的 MariaDB 服务器相对应的手册 - error in your SQL syntax; check the manual that corresponds to your MariaDB server 查询失败您的SQL语法有误。 检查与您的MariaDB服务器版本相对应的手册 - Query Failed You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version 您的SQL语法有误; 检查与您的MariaDB服务器版本相对应的手册 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version SQL语法错误; 检查与MariaDB服务器对应的手册 - SQL syntax error; check the manual that corresponds to your MariaDB server 检查与您的 MariaDB 服务器版本相对应的手册,了解在“数组”SQL 附近使用的正确语法 - check the manual that corresponds to your MariaDB server version for the right syntax to use near '"Array" SQL 您的SQL语法有误; 检查与您的MariaDB服务器版本相对应的手册以使用nea的正确语法 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use nea 您的SQL语法有误; 检查与您的MariaDB服务器版本相对应的手册,以在第1行的&#39;1&#39;附近使用正确的语法 - 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 '1' at line 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM