-3

Error is occurring in this code:

<?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';
}

?>

please give me some clues data is not stored in my database the error is coming in

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • You have a typo here if (!mysqli_query($con,$sql){ you miss a brackets. It must be brackets if (!mysqli_query($con,$sql) ){ – Sfili_81 Sep 05 '18 at 06:35
  • if(!mysqli_query($con,$sql) , You have missed round bracket on that line it must be if(!mysqli_query($con,$sql)){ //Your code here } – H45H Sep 05 '18 at 06:37
  • "Not working" is not a sufficient problem description. Unless you check for errors or showcase database schema and sample contents, this remains unanswerable either way. The horrible formatting doesn't help your matter. And as aside `$var = isset($_GET[xyz])` will merely leave a boolean, not the string. See also [ask] and [mcve] to improve your question and thus answers you can receive. – mario Sep 05 '18 at 06:56
  • tell me what type of error i have done in this code – RK TECHNOLOGY SCIENCE Sep 05 '18 at 07:03
  • i have written problem in heading please see that – RK TECHNOLOGY SCIENCE Sep 05 '18 at 07:04

1 Answers1

0

You missed a bracket

   if(!mysqli_query($con,$sql)

it should be

   if(!mysqli_query($con,$sql))
JeffB
  • 191
  • 1
  • 15