I'm gathering data from another page and i'm sending it to process and send the data to my database table. This is the code for that.
require "config.php";
if ( $_POST['insertPost'] == true ){
$postTitle = $_POST['title'];
$postContent = $_POST['content'];
$postImage = $_POST['image'];
$postDate = $_POST['datetime'];
$categories = $_POST['categories'];
$c->query( "INSERT INTO blog ( title, content, image, datetime, categories ) VALUES ( '$postTitle', '$postContent', '$postImage','$postDate', '$categories')" );
//echo "Inserted";
}
This is what the table looks like.
How can I get the ID info of the inserted data and store it into a variable ?