close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

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 Jason Byrnes | 759 views | 3 replies |

bjutaski295451

login then display customer table row

Hey everyone,

My question:

After a user registers, they then log in, then they are taken to a members.php page to see their acctount information off of the same table. The issue I have is the member.php page is not showing their information it is just pulling from the first record in the table. whats the code to only display the information for whom ever is logged in at that time??

Sign in to reply to this post

Jason ByrnesWebAssist

when the user logs in, a session variable is created with their ID form the users table.

On the members page, set the recordset to filter the ID column of the users table on the ID session that is created.

if you need more specific detail, send a copy of your login page and the members page in a zip archive.

Sign in to reply to this post

bjutaski295451

Hi Jason

I figured out the session name, thats what I needed. Now I have another issue, I have a user table and products table, after the user logs in i want them to be able to "update" a product they are wanting... however I need this to stay dynamic meaning if they have loaded the product into their account, if I change the product "options" (name, total, anything) it will change instantly on the user table. I have biult the relations correct I think. I have attached a simple demo of what I need it to do (included the db too)... Thank you for your assistance.

Brian

Attached Files
demosite.zip
Sign in to reply to this post

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

Sign in to reply to this post

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...