Based on the code you provided, it seems that you're missing the actual execution of the SQL query to insert the values into the database. After constructing the query, you need to execute it using the `mysqli_query()` function. Here's an updated version of your code that includes the execution of the query:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="$1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<title>test</title>
<?php
include_once 'dbConfig.php';
?>
</head>
<body>
<?php
if(isset($_POST['save'])){
$sql = "INSERT INTO users (username, password, email)
VALUES ('".$_POST["username"]."','".$_POST["password"]."','".$_POST["email"]."')";
// Execute the query
$result = mysqli_query($mysqli, $sql);
if ($result) {
echo "Data inserted successfully!";
} else {
echo "Error inserting data: " . mysqli_error($mysqli);
}
}
?>
<form method="post">
<label id="first">First name:</label><br/>
<input type="text" name="username"><br/>
<label id="first">Password</label><br/>
<input type="password" name="password"><br/>
<label id="first">Email</label><br/>
<input type="text" name="email"><br/>
<button type="submit" name="save">Save</button>
<button type="submit" name="get">Get</button>
</form>
</body>
</html>
In this updated version, after constructing the `INSERT` query, it is executed using `mysqli_query($mysqli, $sql)`. The result of the query execution is stored in the `$result` variable. If the query is successful, it will display a success message. Otherwise, it will display an error message along with the specific error generated by MySQL.
Make sure to replace "pass" in the `dbConfig.php` file with the actual password for your MySQL root user. Additionally, ensure that the table name and column names in the `INSERT` query match your database schema correctly.