Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Easy question, get info from DB
Old 03-23-2005, 12:02 PM Easy question, get info from DB
Hawkallica's Avatar
Novice Talker

Posts: 7
Trades: 0
Hey, I have made an appliacation, but I need to know how to get information from a row only depending on which is it is logged in. Can someone help me with this?

Thanks for your time!
Hawkallica is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-23-2005, 12:04 PM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
Do you mean fetch a row depending on "who" is logged in?
__________________

Please login or register to view this content. Registration is FREE

FREE PHP scripts for your website!
simptech is offline
Reply With Quote
View Public Profile
 
Old 03-23-2005, 12:22 PM
Hawkallica's Avatar
Novice Talker

Posts: 7
Trades: 0
yeah
Hawkallica is offline
Reply With Quote
View Public Profile
 
Old 03-23-2005, 12:42 PM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
just make an associative table that says which user has access to which rows.

Code:
Table: users 
Field: user_id
Field: user_name
Field: user_password
 
Table: items
Field: item_id
Field: item_name
Field: item_description
 
Table: access
Field: access_id
Field: access_user_id
Field: access_item_id
When the user logs in, track their user_id in a session or cookie. Then when you need to limit what they can view, use code similar to what is below:

Code:
SELECT * 
FROM access
LEFT JOIN items ON item_id = access_item_id
WHERE access_user_id = '[USER_ID]'
does that help, or am I way off target?
__________________

Please login or register to view this content. Registration is FREE

FREE PHP scripts for your website!
simptech is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Easy question, get info from DB
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13040 seconds with 12 queries