Reputation: 769
I have a simple php user profile system that works like this: When user is registered he gets a specific url ?user
. Therefore, other visitors can access his page.
What I want it to include chat application on users profile pages. But, every single user should have its own chat. Which approach is the best, as I am a beginner in this? Should I put the messages from chat into the database or should I work with some log.txt files?
Any good tutorial for this would be helpful.
Upvotes: 0
Views: 1295
Reputation: 489
I found some tutorial for you: http://tutorialzine.com/2010/10/ajax-web-chat-php-mysql/ - looks like it could help you.
The only thing you need to adjust is to add room
column in WEBCHAT_LINES
table - that will be the unique name of the user, into which's chat room the chat line belongs. Then, when new chat line will be sent, you must save it to DB with apropriate room identificator. When you display the messages in chat, you must filter the results in each room to show only the lines for this particular room.
If you haven't use database before, there are plenty tutorials about mysql around the internet - it's not that difficult.
Good luck! And use Google when you'll have some doubts.
Upvotes: 2