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] Link to comment https://forums.phpfreaks.com/topic/199065-make-unique/ 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- Link to comment https://forums.phpfreaks.com/topic/199065-make-unique/#findComment-1044958 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. Link to comment https://forums.phpfreaks.com/topic/199065-make-unique/#findComment-1045000 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.