$conn = new mysqli("localhost", "root", "", "login");
if ($conn->connect_error) {
die("ERROR: Unable to connect: " . $conn->connect_error);
}
echo 'Connected to the database.';
$result = $conn->query("SELECT * FROM usuario");
echo "Number of rows: $result->num_rows";
$result->close();
$conn->close();
?>
//I receive this message:
Inserttodb.php
{
mysqli_query($link,"insert into table1 values('$_POST[t1]','$_POST[t2]')");