Welcome Guest, Not a member yet? Register   Sign In
How to insert non-duplicated data on a database?
#3

[eluser]João Ramos[/eluser]
That's quite clever! So I just basically try to insert everything and MySQL will take care of ignoring duplicate contents, right? In case there's an error, will MySQL stop the entire insert query or will just ignore the duplicate contents?

[quote author="smilie" date="1328633922"]Well, the best way would be to make your field unique; this way, MySQL will return error in case you try to enter duplicate entry. Ofcourse, try to check your (insert) code as well, but in this case if you make mistake somewhere then MySQL will still stop it.

But in regard to your PHP code, only thing I can think of is to test (perform select) before you insert it;

Cheers,
Smilie[/quote]


Messages In This Thread
How to insert non-duplicated data on a database? - by El Forum - 02-07-2012, 09:28 AM
How to insert non-duplicated data on a database? - by El Forum - 02-07-2012, 09:58 AM
How to insert non-duplicated data on a database? - by El Forum - 02-07-2012, 10:02 AM
How to insert non-duplicated data on a database? - by El Forum - 02-07-2012, 10:08 AM
How to insert non-duplicated data on a database? - by El Forum - 02-07-2012, 10:10 AM
How to insert non-duplicated data on a database? - by El Forum - 02-07-2012, 10:17 AM
How to insert non-duplicated data on a database? - by El Forum - 02-07-2012, 02:58 PM
How to insert non-duplicated data on a database? - by El Forum - 02-08-2012, 04:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB