store in my sql only if not exists
Posted: Wed Oct 29, 2003 6:05 am
hello all,
I have a unique field in a specific mysql table.
What I want is to build a function that gets this unique value and check if it exists in my table and only if not store it!
I want to find a smarter way than making 2 queries:
1. for checking if it exists
2.for storing
is that possible or I need to compremize?
Thanks
I have a unique field in a specific mysql table.
What I want is to build a function that gets this unique value and check if it exists in my table and only if not store it!
I want to find a smarter way than making 2 queries:
1. for checking if it exists
2.for storing
is that possible or I need to compremize?
Thanks