Jump to content

PHP and MySQL help please?!


hlstriker

Recommended Posts

Hey I have a quick question. I am trying to make a page that users can sign up, then later on add things of what they have to sell. Would I need to give each user their own table for this, or could I somehow do it with 1 table?

For example: User "Ned" signs up, then he later on adds things to sell (which would go into a field).

There will be multiple users, that's why I wondered if I had to make more then 1 table, since I don't know if there could be multiple item's in 1 field?
Link to comment
https://forums.phpfreaks.com/topic/15772-php-and-mysql-help-please/
Share on other sites

[quote author=AndyB link=topic=102022.msg404360#msg404360 date=1153972828]
Two tables - one for users, the other for items for sale

table 1: user_id, username, password, email, whatever else - one record per user
table 2: id, user_id, item_for_sale,price, whatever else - one record per item for sale
[/quote]


Is id in table 2 a primary key? If so, what if a user_id has many things to sell? Shouldn't there be just a table that list just the unique item for sell?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.