so i have this website where i can log in and then make a job offer from the account, all my accounts have an auto increment id in my database. if i fill in this form it'll save all the information to my database with a new id for the job offer but i also need to link the id from the logged in account with it, whenever i save it it just says 0 at the id cause i haven't linked it. any idea how i have to do this?
<form method="post">
<div id="formbackground"><br><br>
<label for="adres">Functie: </label>
<br> <textarea rows="4" cols="32" name="functie" required></textarea> <br><br>
<label for="adres">Omschrijving: </label>
<br> <textarea rows="4" cols="32" name="omschrijving" required></textarea> <br><br>
<label for="adres">Salaris: </label>
<br> <textarea rows="4" cols="32" name="salaris" required></textarea> <br><br>
<input type="submit" name="verzenden" value="Vacature publiceren" class="btn-login">
</div>
</form>
</div>
<?php
if(isset($_POST['verzenden'])){
$conn = mysqli_connect('localhost', 'root', '', 'powerjobs');
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$functie = htmlspecialchars($_POST['functie']);
$omschrijving = htmlspecialchars($_POST['omschrijving']);
$salaris = htmlspecialchars($_POST['salaris']);
$sql = "INSERT INTO vacature
(functie, omschrijving, salaris)
VALUES ('$functie', '$omschrijving', '$salaris')";
if ($conn->query($sql) === TRUE) {
header("Location: inlog-bedrijf.php");
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}
?>