I am currently working on school project and am developing a simple discussion forum. I have a problem right now, I want to get the id of the newly inserted row of a user once the user asks a question and I will also like to pass the id to another page and display then question. What I really want is something similar with this stackoverflow when you post a question it take to another page and display it. Please how can I achieve this, any help is welcome. the id is auto increment
<?php
if(isset($_POST["title"]) && isset($_POST["question"]) ){
$title = $_POST["title"];
$ask = $_POST["question"];
$sql = $con->prepare("insert into question(userid,title,question)values(?,?,?)");
$sql->bind_param('iss',$userid,$title,$ask);
$sql->execute();
$sql->close();
}?>
i just used the code post the question but i don't know what next.