Having trouble getting the data to insert into Maria DB. While attempting this project I have used about every source I can think of and I'm resorting to posting a question online. Below is my code and the error it produces is "Fatal error: Call to undefined method mysqli::mysqli_prepare() in C:\xampp\htdocs\scripts\insert.php on line 12". Been mulling over this for a couple days and so far I have found nothing at all on youtube or stackoverflow.
<?php
//Set up credentials
$servername = "localhost";
$username = "root";
$password = "";
$database = "test";
$db = new PDO("mysql:host=localhost;dbname=test;","$username","$password");
// Create connection
$link = new mysqli($servername,$username,$password,$database) or die($mysqli->error);
$a = $_POST["a"];
$sql = "INSERT INTO ass (asdf) VALUES('$a')";
$result = $link->mysqli_prepare($sql);
$stmt = $database->mysqli_prepare($sql);
$stmt->execute(array($_POST['a']));
$stmt->close();
?>