Hi guys I'm back. If I could I would like to get a confirmation that my code as written will work correctly before I implement it:
This is from my create_post.php file in my new blog infusion.
$epoch = time();
$posted = $epoch;
$result = dbquery("INSERT INTO ".DB_GRIMS_BLOG_POST." (post_id, topic_id, post_title, post_body, post_img, post_thb, posted, active) VALUES ('', '$topic_id', '$post_title', '$post_body', '$post_img', '$post_thb', '$posted.', '$active')");
$last_id = LAST_INSERT_ID();
$month = date("m", posted);
$result = dbquery("INSERT INTO ".DB_GRIMS_BLOG_POST_TOPIC." (post_topic_id, post_id, topic_id, month) VALUES ('', '$last_id', '$topic_id', '$month')");
Any help/insights would be appreciated very much.
Edit: I went ahead and tried it and got an error: [24-Nov-2020 11:27:12 America/Chicago] PHP Fatal error: Uncaught Error: Call to undefined function LAST_INSERT_ID() in /home/whisperw/public_html/infusions/grims_blog/admin/create_post.php:53
I don't understand why the error. I looked up how to get the last inserted id and thought that was it!