Check out example codes for "mysql insert mysqli". It will help you in understanding the concepts better.

Code Example 1

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "database";
// Create connection
$conn = new mysqli($servername, $username, $password,$dbname);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>Copy

Learn ReactJs, React Native from akashmittal.com