Ninjakreborn Posted July 13, 2006 Share Posted July 13, 2006 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 betterThe system is under php 4, and mysqlwhat 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 thisidmessageuserfromthe 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 tableI log the id numberwho 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 likeid252692352346those 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 possibilityEverytime 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. Quote Link to comment https://forums.phpfreaks.com/topic/14520-question/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.