Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2008
    Posts
    79
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Question about status updates

    Ok so I'm going to try something like a wall but it's not a wall.
    It's a chat box that also adds certain activities to it as well.
    So peoples chat will come up and some times "so and so has done this"

    My question is what would be the best way to store this data?
    If I do it in one table it'll get quite bulky but I could do a cron every few hours that deletes chat entries older than said datetime

    Or would it be better to have 2 seperate tables one for chat one for activity?
    Then I'd have to do a bit more coding but would this way be more efficient?

    Any thoughts on this would be most appreciated

    Thanks

    Carl

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    If you are intending to do things like delete and search, a database will make life a lot easier.
    How many tables you use depends on how much needs to be normalized. If many 'chats' include many 'activities', you need to use 3 tables in a relational database as you cannot represent many to many relationships between two tables. This appears to require 2 tables as many 'activity' is associated with one 'chat'.
    You don't really have a lot of information to work with here, so I don't think I can really suggest much else.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    New Coder
    Join Date
    Oct 2008
    Posts
    79
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Well heres what I am trying to achieve overall.

    There is a chatbox on the page which is updated with jquery
    in the chatbox there is a field where you can type and send a message that then appears in the the chatbox
    but if someone makes a request for a song (its for my internet radio) then also post in the chat (so and so requested this song)
    then if someone "likes" the request (so and so like whoevers request for artist - song)
    same goes with comments,friends etc

    then at some point (just a thought not definitely) have the activity on peoples profile, in which case i wont want the chat messages by said user id just other activity

    hope this is more of an insight


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •