close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Help needed to display values from DB.

Thread began 1/08/2012 9:09 am by Kumel | Last modified 1/09/2012 10:33 am by Jason Byrnes | 1341 views | 5 replies |

Kumel

Help needed to display values from DB.

I have a product table DB & in that there is many columns. One of the column name is - > productUser.

TABLE NAME - PRODUCT
1 of the COLUMN NAME is - productUser

productUser contains userid of the user..

So in that column i enter USERID of the users...

So when a user login's i want to productUser to be filtered & want to display how many product are for them from PRODUCT'S TABLE... ei. 1,2,3, or etc ...

Hope u were able to understand.

Sign in to reply to this post

Ian S

When the user logs in you need to store the user ID in a session variable.

Then filter the products products table with the value of the user ID in the session variable.

Cheers
Ian

Sign in to reply to this post

Kumel

I guess u didnt understand my question..

Simple Example:

TABLE NAME PRODUCT:

COLUMNS:

ProductID ProductName ProductUserId
1 sample1 3
2 sample1 4
3 sample1 3
4 sample1 8


So now lets say i login & my userID is 3.

So i want to display no 2 by filtering ProductUserId from PRODUCT DB.

Sign in to reply to this post

Ian S

I dont understand what you are asking.

If ProductID has a userid of 4, and your user has a userid of 3, why would you want that returned?

If you want to display the products for the user that is logged in, then my example works.

Thanks
Ian

Sign in to reply to this post

Kumel

I guess u didnt understand my question..

Simple Example:

TABLE NAME PRODUCT:

COLUMNS:

ProductID ||| ProductName ||| ProductUserId
1 ||| sample1 ||| 3
2 ||| sample1 ||| 4
3 ||| sample1 ||| 3
4 ||| sample1 ||| 8


So now lets say i login & my userID is 3.

So i want to display no 2 by filtering ProductUserId from PRODUCT DB.

Nw did u understand?

I just want to display no of products available for him.. dats it.

Sign in to reply to this post

Jason ByrnesWebAssist

well, your sample data doesn't make sense with your question.

you say:
So now lets say i login & my userID is 3.

then say:
So i want to display no 2 by filtering ProductUserId from PRODUCT DB.


and your sample data for product 2 says:
ProductID ||| ProductName ||| ProductUserId
2 ||| sample1 ||| 4

which is for User ID 4, not for User ID 3

the sample data for product ID 1 is for userID 3:
ProductID ||| ProductName ||| ProductUserId
1 ||| sample1 ||| 3


nevertheless, Ian S's initial response:

  When the user logs in you need to store the user ID in a session variable.

Then filter the products table with the value of the user ID in the session variable.  



is the correct way to do what you are asking about.

you use the UserID session variable created at login to filter the ProductUserId column of the products table.

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