I am not using localhost and I tried my best, as a newer to PHP, to insert data to SQL but I was unsuccessful.
The codes are as follows:
<?php
$host= "AAAA";
$user= "AAAA";
$pass= "AAAA";
$db= "AAAA";
$x1 = $_POST['X1'];
$x2 = $_POST['X2'];
$y1 = $_POST['Y1'];
$y2 = $_POST['Y2'];
$con=mysqli_connect($host,$user,$pass,$db);
$sql = "INSERT INTO table (X1, X2, Y1, Y2) values ('$x1', '$x2', '$y1', '$y2')";
$result = mysqli_query($con, $sql); // execute the query
?>
I want to insert data into SQL, but not sure why I do not get into it. I do not get any error in the form, but When I check SQL, I cant see the data that I have entred.