Storing a combination of IDs For my scenario I have already created a database user id that is auto incremented and they have already put their company id number in the registration. In the registration table both inputs are stored, but I would like to combine both together in a (database_id) (user_id) + "_" + (company_id) form so that everyone who has signed up for the application is unique in the database. Would this be possible?
Well, I think the questions is not well formulated, but as far as I got it:


You have a table containing two columns user_id and company_id
You have set the user_id to be AUTO_INCREMENT (so it's a PRIMARY KEY)
You are willing to change this column to user_id + "_" + company_id to make it UNIQUE


Answer: you're doing it wrong

Both data must not be concatenated.

Instead, what you want is a (user_id, company_id) UNIQUE KEY, which can be done with an ALTER TABLE my_table ADD UNIQUE INDEX user_company (user_id, company_id).

Thus, the way you want your AUTO_INCREMENT to work is not clear. IMO, you should remove it from the user_id, and add it on a new dedicated column id. Then, when you INSERT/UPDATE in that table, you'll have to know the user_id you're inserting/updating, which makes sense since that user_id is no longer UNIQUE to identify a row.