Itupto.com Upload
Search: for

Mysqli Insert Query - PHP Code
Learn
First, Create Mysql Username and Password and Database Second, Create a Table "sms" in Database Third, Create a Row "id and title" in Table.   Then, Edit following codes to connect your database and username with Mysql.  
 <?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
?>
  Then, Create a file "insert.php" and add following codes inside of the file.
 <?php
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

$sql = "INSERT INTO MyGuests (firstname, lastname, email)
VALUES ('John', 'Doe', 'john@example.com')";

if ($conn->query($sql) === TRUE) {
  echo "New record created successfully";
} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>
  Full Codes
  <?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

$sql = "INSERT INTO MyGuests (firstname, lastname, email)
VALUES ('John', 'Doe', 'john@example.com')";

if ($conn->query($sql) === TRUE) {
  echo "New record created successfully";
} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>
  Source: www.w3schools.com
Date: 2022-12-24 11:05:24
More for You
List
  Mysqli Insert Query - PHP Code
  Search query by id Mysqli - PHP Code
  PHP MySQLi Ajax Live Search - PHP & Mysqli Code
  PHP mysqli get_client_info() Function - Return the MySQL client library version:
  PHP mysqli affected_rows Function - Example - Object Oriented style
  Php Mysqli Number Row Php Code
  Display Image From Mysqli Database Php Code
  Call To Undefined Function Mysqli_fetch_all() Sql Code
  Mysqli_test Php Code
  Mysqli Open And Close Connection Php Code