karimali831 Posted April 19, 2010 Share Posted April 19, 2010 Hi I want to make "ID" from one table and "userID" from another table unique, so they can't be the same and if userID already exists, it will get the next available one if that makes sense. Is this hard to do? [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
ChemicalBliss Posted April 20, 2010 Share Posted April 20, 2010 So if an id of 1 exists, you want to stop anyone having a userid of 1? If so, you have a flaw in the structure of your database. You would use an Intermediary table, so there is only one single table that stores all the id's, that id can be used to pull record from other tables. -cb- Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted April 20, 2010 Share Posted April 20, 2010 Make it a primary key and auto-increment. Then you don't have to worry about it. The database will handle it and it will be unique. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.