This question already has an answer here:
<?php //start php tag
//include connect.php page for database connection
include('connect.php');
if(isset($_REQUEST['submit'])!='')
if ($_REQUEST['name']==''||$_REQUEST['email']=''||$_REQUEST['password']==''||$_REQUEST['repassword']==''){
Echo "please fill theempty field.";
}Else{
$mysqli="insert into user(naam,email,password)values('".$_REQUEST['name']."','".$_REQUEST['email'].",'".$_REQUEST['password']."')";
$res=mysqli_query($mysqli);
if($res) {
Echo "Recordsuccessfully inserted";
} Else{
Echo "There is some problem in inserting record";
}
}
}
?>
I keep getting the same error and can't find what's actually the problem, or maybe I just didn't see.
this is my connection
<?php
$hostname="localhost";
$username="root";
$password="";
$database="website";
$mysqli=mysqli_connect($hostname,$username,$password,$database);
if(! $mysqli){
die("Connection Failed:".mysqli_error());
}
mysqli_select_db($database,$mysqli);
?>
</div>