I have created a php script which insert values in my database, but it's not working, there no error in connection there is also no error in database.
I have also tried query in the phpmyadmin and it works perfectly, please help me out here's the code you can run it i've changed the password..
<?php
$con= mysqli_connect("mysql.hostinger.in","u744363236_users","stackoverflow","u744363236_users");
// Check connection
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
$name1 = $_POST['name'];
$phone1 = $_POST['phone'];
$password1 = $_POST['password'];
$sql = "INSERT INTO users (name,phone,password) VALUES ($name1,$phone1,$password1)";
if(mysqli_query($con,$sql)){
echo 'succeed';
}
else{
echo 'failure';
}
mysqli_close($con);
?>