Try die()
like following in your php file:
$connection = mysqli_connect($host,$user,$password,$database);
/* check connection */
if (mysqli_connect_errno()) {
die("Connect failed: ", mysqli_connect_error());
}
$query="insert into users(firstname, lastname)VALUES('".$_REQUEST['nome']."','".$_REQUEST['cognome']."')";
if ($result = mysqli_query($connection ,$query))
{
print("Success!");
}
3
solved Connect to Database and Insert data – Php & MySQL –