my database name is login and has a table called users three columns:name,id and post. when I hit the submit button, the id is incremented and a new record created but no actual data is created in these fields. please help
<?php
$servername="localhost";
$username="root";
$password="";
$dbname="login";
$conn=new mysqli($servername,$username,$password,$dbname);
if($conn->connect_error){
die("connection error:".$conn->connect_error);
}else{
echo 'connected successfully';
}
#defining varriables
$user_name = isset($_POST['user_name']);
$post = isset($_POST['post']);
#connect this to login details and pick the userrname
$sql="INSERT INTO posts(user_name,post)
VALUES('$user_name','$post')";
if($conn->query($sql)===TRUE){
echo "your post was published";
}?>
form data
<form action="" method="post">
<input type="text" name="user_name"/>
<input type="text" name="post"/>
<input type="submit" name="post to cdrone"/>
</form>