In mysql or mysqli you can add this type of Query:
<?php
$sql = mysqli_query($con, Insert into database itt (name) VALUES ($name)") or die(mysqli_error($con));
?>
What does wordpress do for this?
Or how does the code look?
Does it look like the code above?