SunQuest
           Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old February 12th, 2003, 04:17 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Please Help - I don't know what I'm doing

:

I'm trying to set up what in essence will be a secure message board - its a mentoring system. The db has been created IN MS SQL Server and i trying to write the web pages in php. My Problems are: -
- i need to search through my database with specific criteria to link a new person to.
- i need to make sure that messages can only be seen be specific users

Some1 any1 please help me figure out how to do this - your help will be greatly appreciated



Reply With Quote
  #2  
Old February 13th, 2003, 07:22 AM
radical_edward radical_edward is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 19 radical_edward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Please Help - I don't know what I'm doing

With any project like this, first of all you need to be sure your database structure will support the kind of application you are trying to build. Could you post a list of your tables and their fields, and explain the relationships between the tables? Also I'll need an idea of what privacy restrictions you need to impose, i.e. whether messages will be totally private between mentor and mentee or if there will be group access to messages, plus some explanation of what you mean by "search through my database with specific criteria to link a new person to". Are we talking well-defined criteria like age or area of expertise, or something more "fuzzy"?

Sorry to sound demanding, but I can't offer practical advice without something concrete to go on.

Reply With Quote
  #3  
Old February 13th, 2003, 09:22 PM
ClaireB ClaireB is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 ClaireB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Please Help - I don't know what I'm doing

Right - the messages between the mentor and mentee will be totally private.

Tables

Mentors – will hold the personal details of the mentor.
Mentees – will hold the personal details of the mentee including who they are being mentored by.
Messages – will hold all the messages that have been sent by the user, will be linked to both the mentor & mentee tables.
MentorsMentees – as the mentee will be able to choose a new mentor we need a table that will show which mentors have mentored who & the messages that they have sent.
Mentor Match – this table will hold the details of the mentors on which the mentee will conduct their searches.

Mentors and mentees joined via mentormentee

mentormentee linked to messages

mentormacth linked to mentor where all the mentors search criteria stored.

if you need any more information give us a shout - thanx very much for doing this.

Claire

Reply With Quote
  #4  
Old February 18th, 2003, 03:38 PM
radical_edward radical_edward is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 19 radical_edward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Please Help - I don't know what I'm doing

For starters, I think you have too many tables here. I'm assuming you want to keep a history of who has mentored whom, rather than just a note of which mentor a mentee currently has. So, I would suggest the following table structure:

Table Members:
* MemberID - unique ID that won't change (like a forum user id)
* Member Name
* Member Password - use password(), encode() or whatever function you feel comfortable with to encrypt this
* Various fields as needed to hold the member's personal details
* Member Status - i.e. mentor or mentee?
* text field for searching by mentees (obviously this field will be empty for mentee records)
N.B. I have lumped mentors and mentees into one table to make the logging in process easier.

Table History:
* Mentor ID - will contain a member ID
* Mentee ID - will contain a member ID
* Date Started
* Date Ended

Table Messages:
* Message ID - an auto-increment field is ideal for this
* Sender ID - will contain a member ID
* Recipient ID - will contain a member ID
* Date
* Message

I use sessions to maintain security. Once the user logs in, the session cookie holds their user id and this is used in subsequent database queries to only show the information that refers to them, e.g. to see my "inbox"
php Code:
Original - php Code
  1.  
  2. // check for a login id in the session
  3. if ($_SESSION['id']) {
  4.  
  5.    // we have one, so get the messages
  6.     $sql = 'SELECT Date, Message, SenderID FROM Messages WHERE RecipientID = "'.$_SESSION['id'].'"';
  7.  
  8. // lots of code here to display the messages...
  9.  
  10. }
  11.  
  12. else {
  13.     // no id, so shunt them to the login page
  14.  Header('Location:login.php');
  15.  
  16. }


Every page that contains user-specific information will need to contain this if/else block. You will obviously also need a login page that checks a member id and password against the entries in the Members table.

If you're new to PHP and databases, I would strongly recommend "PHP Essentials" by Julie Meloni - it has lots of great practical examples and isn't too heavy on the techie details

Ed

Reply With Quote
  #5  
Old February 18th, 2003, 04:14 PM
ClaireB ClaireB is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 ClaireB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Please Help - I don't know what I'm doing

Thanks a lot i'll try this

Claire

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Please Help - I don't know what I'm doing


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway