<[EMAIL PROTECTED]> wrote ...
> I am creating a web site which allows users to post projects and then
> others to place bids. I am setting up two tables in MySQL 'Projects'
> & 'Bids' my problem is how best to cross reference. What I was
> thinking of doing is creating a number of fields in the Projects table...
>
> and then inserting the BidID from the bids table into Bid1, and if
> that is already used then it will go into Bid2. But how many Bid#
> shall I create?? I`m sure there must be a faster method than this,
> anyone have any suggestions??

This is a standard question where you have two tables that need to be linked
in a many-to-many relationship. The answer is that you need a third table,
called for example ProjectBids. It has two columns, one for Bid ID and one
for Project ID. Each row links one bid to one project. You can enter as many
rows as you like, so each bid can be linked to one or more projects, and
each project can be linked to one or more bids.

But are you sure you have a many-to-many relationship? It sounds like each
bid might be associated with just one project. In that case you could just
have a column in the Bid table that contains the Project ID.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to