close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

login then display customer table row

Thread began 9/07/2011 2:13 pm by bjutaski295451 | Last modified 9/12/2011 3:01 pm by bjutaski295451 | 770 views | 3 replies

Jason ByrnesWebAssist

your approach for this is not correct.

For one, to relate a product from the products table to the user, you should only store the productID in the users table, then use a join query to return the related info from the products table, for example:

SELECT users.*, products.*
FROM users
INNER JOIN Products ON users.productID = products.ProductID


however, this structure is very limiting, it is create a 1 to many relationship. it means that a user can only have 1 product, you would probably want any one user to have multiopple products.


for this you would need to create a many to many relationship using a linking table.


for exampl:

users:
userID - primary key
userName - text
etc....

products:
productID - primary key
productName - text
etc....


userProducts:
userProductID - primary Key
userProductUserID - relates to users.userID
userProductProductID - relates to products.productID


the join query to use would now be:

SELECT users.*, products.*
FROM users
INNER JOIN userProducts ON users.userID = userProducts.userProductsUerID
INNER JOIN products ON products.productID = userProducts.userProductsProductID

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...