Most of the posts I found involve using PHP but I am not using PHP in my case. Here is my MySQL procedure
CREATE DEFINER=`root`@`localhost` PROCEDURE `create_email`(in UID_ int(20),
in user_id_ int(20),
in from_email_ VARCHAR(1024),
in subject_email_ TINYTEXT,
in body_email_ LONGTEXT,
out id_ BIGINT(20) unsigned )
BEGIN
set id_=0;
INSERT INTO emails (UID, user_id, from_email, subject_email, body_email)
VALUES
(UID_ ,user_id_, from_email_, subject_email_, body_email_);
set id_ = LAST_INSERT_ID();
END
Currently my procedure does not check if the data in the table exists it only inserts as the data is being received. What is an effective way of making sure incoming email data does not dublicate onto my emails table?
Thank you in advance.