Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-20-2010, 09:40 PM   PM User | #1
CarlLawl
New Coder

 
Join Date: Oct 2008
Posts: 79
Thanks: 0
Thanked 7 Times in 7 Posts
CarlLawl is an unknown quantity at this point
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
CarlLawl is offline   Reply With Quote
Old 12-21-2010, 02:08 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 12-21-2010, 06:25 PM   PM User | #3
CarlLawl
New Coder

 
Join Date: Oct 2008
Posts: 79
Thanks: 0
Thanked 7 Times in 7 Posts
CarlLawl is an unknown quantity at this point
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
CarlLawl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:46 AM.


Advertisement
Log in to turn off these ads.