Jump to content


Photo

question


  • Please log in to reply
No replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 13 July 2006 - 06:34 PM

I have a little issue, I am trying to work through, I am trying to create an ebay close, lost and found system online.
I have to set up something for an email system, or message system.  I just finished creating a giant custom file management system, and I loved it so, now that that was finished I started on this.
I have 2 choices, I want to know if anyone has any advice on which  one would be better
The system is under php 4, and mysql
what I am trying to do is I have a registration form, that gives them login access, there are 2 types of accounts, free and paid, it starts logging the field under paid to no, and paypal id, as not applicable.  Then when I pull my info from my database, I register my cookies to the username and password, and then the id.  Then they can search the site, maybe even paid sections, but the db is searched for there id, and the paid column is checked, if its yes, they get access, if it's no, it is denied.  So that is my overall system idea, the next thing, is a feature to allow people to message each other, by what I have brainstormed I have 2 choices, I want some feedback on these, because I know how to do either,but I don't know which would be better, worst, slower, or whatever.

First of all the people will be able to message other members, it messages with a userid, and that userid pulls the rest of the information from the database.

I already am going to set some stuff in place to make sure that the username, and other stuff don't already exist, because the username is going to have to remain different.
I can do either
1. The person sends a message my scripts pulls up there username, and all there information,
I have 1 table, that is labeled messages, with the info pulled up by the username, the table is like this
id
message
userfrom

the id is going to be the id of the member where the username was found, for instance, if I have member number 50, he signed up, his username is danny, then paul user number 20 sends him a message, he types danny in the username field, types the message and clicks send, all simple.  Then the scripts takes $username = "danny";
and it searches my userreg table to see if danny exists in the database, if it does, it pulls out all the information in his row adn get's his id number, then in my new table the message table
I log the id number
who the user was that sent it, and the message.
THen if I have more than 1 message it'll just show up in the database as multiple entries with the same id, and I won't auto-increment them in that db, I will put them in there manually each time, to make sure they stay numbered right.
The thing is I would have like
id
2
5
2
6
9
235
2346
those are the current people in the db that have messages for instance, when someone say id#2 user signs in.  he signs in with his username and password, it checks the db, pulls out the info registers the sessions, and has his id on hand.  Then it runs that id against the other database, if one is found I have  a message somewhere that says you have messages, then I just pull those messages from the db,all teh ones under that id.

2.  Second possibility
Everytime someone signs up under a new username I create an entirely new individual table with that persons id, and call it id#, the number is replaced with there id number, and each person has a new table, and the new tablew ill be able to record however many message are sent to that person.
I was thinking this, but I am afraid it will be slow, which way do you advice.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users