-7
我想在我的SQL插入由GET数据,但我不能插入数据插入数据通过GET
<?php
include("config.php");
$f=$_GET["first_name"];
$l=$_GET["last_name"];
$e=$_GET["email"];
$m=$_GET["mobile"];
$b=$_GET["birthday"];
$g=$_GET["gender"];
$insert="INSERT INTO user (`first_name`, `last_name`, `email`, `mobile`, `birthday`, `gender`)
VALUES ('$f', '$l', '$e', '$m', '$b', '$g')";
mysqli_query($insert);
?>
我通过这个链接尝试插入数据:
你正在使用错误的GET数组。 '?f'?这将无法正常工作。你也需要'&'运算符。 –
您也没有将db连接传递给查询。阅读手册http://php.net/manual/en/mysqli.query.php –
您可以[** SQL注入**](https://www.owasp.org/index.php/SQL_Injection )。至于你的问题,考虑一下:你正在''_GET'中使用不存在的值。这并不奇怪,不起作用。 –