I had this question after viewing fade new row in after record insert with jQuery/ajax/php
So, this loads the last record inserted ID into the table of records and fades in as I wanted per the above question.
$stmt = $link->prepare("INSERT INTO `voucher_categories`(`category_name`) VALUES (?)");
echo $myoutput = $stmt->insert_id;
The problem is, I don't actually want the ID number to display, but rather the category name for that particular ID. Do I need to run another SELECT prepared statement or is there a way to do that in the existing (above) prepared statement?