PDA

View Full Version : two ID cols



james438
09-04-2007, 02:32 AM
I have two tables that show news articles with one table for each topic. It dawned on me that this was not very efficient. The problem is how would you set up a table where you set up a table where there are two IDs that auto increment, but each ID would auto_increment only when a topic for col1 or col2 is added to the table.

For example col1 has a new entry submitted, so the ID for col1 is auto_incremented. When col2 has a new entry the ID for col2 is auto_incremented.

Just curious what the best way is to go about this type of table setup, thanks :)

Twey
09-04-2007, 03:32 PM
You don't, you have a single table with a column that defines what the article's topic is.

james438
09-05-2007, 05:08 AM
ok :( I guess I'll figure something else out. I have a few ideas still.

codeexploiter
09-05-2007, 05:27 AM
You need to use an efficient and flexible database structure that is suitable for your purposes. If you can tell what you are dealing with I hope we may be helpful.