Im i have a php form to enter data into a mysql database, my question is how do i handle duplicate records for example if an ID number already exsists how do i check if exsists
Add a unique index constraint on the loan_id column. MySQL will throw an error when your application attempts to insert another row with the same value.
SQL will look similar to:
CREATE UNIQUE INDEX loan_id_index ON table_name (loan_id);