jbrill Posted July 23, 2007 Share Posted July 23, 2007 I have been trying to get two different rows to auto increment in the same table? If so how do i do it? it says u can only have one primary (obviously) and that is the auto incrementing field. Is there any way around this? here is the mysql error form phpmyadmin... #1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 24, 2007 Share Posted July 24, 2007 i guese the error answer the question and why? thats a waste of allocation look when you have one incrementing fields it same as 3 or more like what you want simply use that field and do some trick Quote Link to comment Share on other sites More sharing options...
jbrill Posted July 24, 2007 Author Share Posted July 24, 2007 right now i have an "id" field that auto increments with every new addition to the table. one of my rows is called "job_number" i would like that to also auto increment to create a unique job number Quote Link to comment Share on other sites More sharing options...
JayBachatero Posted July 24, 2007 Share Posted July 24, 2007 What are you using the id field and the job_number field? They will be the same number so might as well ust use one of them. No need for dup data. Quote Link to comment Share on other sites More sharing options...
jbrill Posted July 24, 2007 Author Share Posted July 24, 2007 they both do two completely different functions, i thought about using the same for both but it just wont work Quote Link to comment Share on other sites More sharing options...
JayBachatero Posted July 24, 2007 Share Posted July 24, 2007 Can you explain what exactly are you planning to do so that we can help you out a bit with the schema. Quote Link to comment Share on other sites More sharing options...
jbrill Posted July 24, 2007 Author Share Posted July 24, 2007 basically, im creating a job management system. quote id's are auto incrementing because every time a job is entered into the database, it needs to be identified by a "quote ID number" however, once the customer approves the quote, the job number is created and is used to identify the rest of the functions the site offers. Here are my concerns with using the quite id as the job number aswell. -when a job is quoted, but declined, it will still be given a job # and it will increment. It needs to have the quote id so if i need to find the declined quotes down the road, i still can. However i do not want it to have a job number.. -for invoicing purposes, usually quote numbers and job numbers are different. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 24, 2007 Share Posted July 24, 2007 for me its better to separate jobs information on other table and then perform join now you can have the auto you need and besides thats normalization all about 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.