The Scenario
I have completely rewritten an old existing ASP classic ecommerce website over to PHP.
The database design of the previous site had
You should have a different get variable name for the new ID. That way in your new program you will know whether to match the product using the old ID or the new one.
$old = isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id'] > 0 ? $_GET['id'] : 0;
$new = isset($_GET['new']) && is_numeric($_GET['new']) && $_GET['new'] > 0 ? $_GET['new'] : 0;
if ($old + $new > 0) {
$query = 'SELECT * FROM `ProductDetails` WHERE '.($old > 0 ? '`OrigPrdID`='.$old : '`PrdDetID`='.$new).' LIMIT 1;';
...