Page 1 of 1

A question about a project Idea.

Posted: Wed Jun 29, 2005 3:46 pm
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

Posted: Wed Jun 29, 2005 4:58 pm
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 ;)

Posted: Wed Jun 29, 2005 5:33 pm
by Gimpy
Thank you. I'll try that.

Posted: Wed Jun 29, 2005 5:47 pm
by timvw
where uid is null (notice that this is different than uid != null)

Posted: Wed Jun 29, 2005 10:12 pm
by Gimpy
Thanks again d11wtq and timvw