|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi
Just wondering... I'm building an app in PHP/MySQL which may potentially be ported to Oracle/Sybase/PostgreSQL/SQLite. In my app, I need to ensure that all usernames are unique. Would it be better to tag the column as unique, try an insert and act upon errors, or query the DB first to see if the username already exists? I'm not sure how the other DBs handle duplicated on unique columns. Thanks.
__________________
R.T.F.M - Its the only way to fly... "No matter what you do, or how good it is, someone will always ask for more features. Or to change the colour of something, then change their minds." Personal: experience// 8 Years Web Development technologies// Standards-compliant, valid, & accessible (x)HTML/CSS, XML/XSL/XPath/XQuery/XUpdate, (OOP) PHP/(My)SQL, eXist/Xindice/XMLDBs packages// Photoshop, Illustrator, Flash/Fireworks/Director environment// FC2, MySQL, Lighttpd, PHP5, Mojavi/Agavi site// //refactored.net/ (Coming soon...) quote// Programming is the eternal competition between programmers who try to make apps more and more idiot proof and the universe that makes dumber idiots. So far, the universe is winning... |
|
#2
|
||||
|
||||
|
see my argument in this thread --
http://forums.devshed.com/showthrea...15&pagenumber=1 if 95 out of 100 are successful, would you like to make 100 calls to the database, or 195? rudy |
|
#3
|
||||
|
||||
|
Yea, thats what I was thinking.
Thanks! |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Exceptions on unique columns. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|