A question about a project Idea.

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Gimpy
Forum Commoner
Posts: 42
Joined: Tue Jun 14, 2005 1:12 am
Location: Fort Worth, TX, US
Contact:

A question about a project Idea.

Post by Gimpy »

Ok you devnet people. I need some help here. I'm designing a contactbook application with php and mysql. I'm here just to try and get my thoughts in the correct order.

The user would log in then they would be sent to a page with options like add contact, search contact, and other stuff. The question I have is how would I go about making it to where the contact is only visible by the user only, like a personal book instead of public. I'm new to php and mysql so any thoughts are greatly appricated in advance and later. :lol:

Thanks,
Bryan
Last edited by Gimpy on Wed Jun 29, 2005 5:48 pm, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Its just a case of having another column in your table called something like "UID" where you put the primary key of the user's record from the users table (or in a really really bad desgin.... just put the user id... but that's silly).

Then all you do to get personal contacts is select from the table WHERE UID=$uid_of_user type of thing. And the get the public ones... WHERE UID=NULL ;)
Gimpy
Forum Commoner
Posts: 42
Joined: Tue Jun 14, 2005 1:12 am
Location: Fort Worth, TX, US
Contact:

Post by Gimpy »

Thank you. I'll try that.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

where uid is null (notice that this is different than uid != null)
Gimpy
Forum Commoner
Posts: 42
Joined: Tue Jun 14, 2005 1:12 am
Location: Fort Worth, TX, US
Contact:

Post by Gimpy »

Thanks again d11wtq and timvw
Post Reply