If a duplicate id error occurs i want to record it into the db. I am using this snippet below, how do i make room for it to insert the error information in the db?

Code:

```
 if ( $postedid === $storedid ) {
 require("error.php");
 die("");
 }else{ 
 echo("");
 }

```