'未插入'-消息即将到来

时间:2018-09-05 06:25:49

标签: php

此代码中发生错误:

<?php
$con =mysqli_connect('127.0.0.1','root','');
if(!$con)
{
echo 'Not connected To server';  
}
if(!mysqli_select_db($con,'rk'))
{
echo 'Database not selected';
}
$Name=(isset($_POST['username']));
$Email=(isset($_POST['email']));
$passward=(isset($_POST['passward']));
$conformpassward=(isset($_POST['conformpassward']));
$sql="INSERT INTO rkgroup (name,email,passward,conformpassward) VALUES 
('$Name','$Email','$passward','$conformpassward')";
if(!mysqli_query($con,$sql))
{
echo 'not submitted';
}
else
{
echo 'inserted';
}

?>

请给我一些线索 数据未存储在我的数据库中 错误即将出现

1 个答案:

答案 0 :(得分:0)

您错过了一个括号

   if(!mysqli_query($con,$sql)

应该是

   if(!mysqli_query($con,$sql))