Hi everyone can anyone please tell me how to aviod entering duplicated data into database using 'insert into'. Thanks a lot
id set a session for that username and make use of the time funcction lil example below if($submit){ if($_SESSION['last_submit'] < time()-100){ return 'Error'; }else{ do some stuff here......... } } summat like that....
have your table a unique field named id and set it as auto increment then you will never have the duplicate rows. and if is to prevent users to insert duplicate then just add user id in table and set as unique. your question is so general it would be better to see your table structure.
The best way to avoid duplicate data in a database can be done this way. 1. Setting up unique fields (combining) 2. Checking if exists in database before inserting (for example with a delay) 3. INSERT INTO .... ON DUPLICATE KEY.....
Hi, thanks I have don what you said, still if insert for example 'omar','ali' as a data and will stored again despite of the data been their.