Forums
This topic is locked
User Login, Spezial Site, table filter
Posted 23 Dec 2001 10:35:36
1
has voted
23 Dec 2001 10:35:36 Anton Sutterlueti posted:
Hi all UD user, first i wanna say thx too all the people that do a big job helping other people with there knowhow.
i am having currently a problem with user auth. what i wanna do is the following, i have diffrent user, each with a username, password and first name, last name, email add etc. now what i wanna do is when the user logs in he sees only the data that belongs to him, i also have other tables that contains news, finazial data, personal data in diffrent tables in the database, is there any way i can filter that so it belongs only to the user i select or is there a way i can work with groups and user together, please help me if there is a tut i would realy need it also contact me thx allot for the help
best regards
Anton (ToXiT)
Replies
Replied 23 Dec 2001 22:00:20
23 Dec 2001 22:00:20 Joel Martinez replied:
well, since you already have the users in the tables, al you have to do is attach the userid to whatever data you want filtered to the user.
then when you query it, filter by the userid that you will no doubt have in a session or something
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
then when you query it, filter by the userid that you will no doubt have in a session or something
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 23 Dec 2001 22:22:08
23 Dec 2001 22:22:08 Anton Sutterlueti replied:
hi could you explain it more in detail how i filter it or how i do it in DW, or what i have to do that it works correct
like a little example would be nice <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
like a little example would be nice <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 26 Dec 2001 16:10:23
26 Dec 2001 16:10:23 Joel Martinez replied:
hmm, well, lets say your user table looks like this <ul><li>userID : autonumber </li><li>username : text </li><li>password : text </li></ul>You could then make any table that holds specific information look like this <ul><li>PostID : autonumber </li><li><b>userID : number </b></li><li> postText : text </li></ul>When you insert a record into the post table above, you would simply include the userID in the record, so you could write a SQL statement that looks like this to see a users posts<pre id=code><font face=courier size=2 id=code>SELECT * FROM userPosts WHERE userID = 2</font id=code></pre id=code>Of course in a dynamic system, the userID would probably come from a session variable or something.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
