Can I go through it step by step, as I am not quite sure I am getting what you want.
(A screenshot may help me ?)
Lets take the ProductID = 45 as an example.
If this product doesn’t exist, then no rows are returned from the recordset. - what do you want to do then ?
Do you want to display something on the current page, ie a message saying that this item does not exist ?
Or do you want to redirect to another page ?
Either way, couldn’t you just put the relevant code in a conditional block ?
<?php if ($recordset->TotalRows == 0) { // Show if mysqli recordset empty ?>
….
<?php }?>
Or something else ?