An example of how you can insert data into a MySQL database using PHP:
```php
<?php
// Replace these with your actual database connection details
$servername = "localhost";
$username = "your_username";
$password = "your_password";
$dbname = "your_database";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
// Sample data to be inserted
$data1 = "John Doe";
$data2 = "[email protected]";
$data3 = "New York";
// SQL query to insert data into the database
$sql = "INSERT INTO your_table_name (column1, column2, column3) VALUES ('$data1', '$data2',
'$data3')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
$conn->close();
?>
```
Replace the placeholders (`your_username`, `your_password`, `your_database`, `your_table_name`)
with your actual database information. Adjust the `$data1`, `$data2`, `$data3` variables and the columns
in the SQL query according to the data you want to insert.
This PHP code connects to a MySQL database and executes an INSERT query to add data to the specified
table. If the insertion is successful, it will display a success message; otherwise, it will display an error
message with details.