PHP Chat concept
Im thinking about taking on a chat room php based project. I want to make sure my logic is right though. This is very raw so please feel free to contribute if you see any problems that might occur.
MYSQL
TABLES
Username
chatroom1
chatroom2
etc..
PHP
Sign up.php
Insert username and password into Username table.
Login.php
Search Username table to validate username and password. Create session.
chatroom1.php
enter message into chatroom1 table. Retrieve messages periodically by new message entered organized by timestamp.
RazorRamon
Junior Poster in Training
74 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
Ajax. For periodic calls to DB.
seems OK. Do you really need to create a chatroom table every time? Depends on your structure I suppose. Can users create their own chatrooms or are there a few that will be available to them?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
I wanted to have a fix number of rooms. I know Yahoo got in trouble a few years ago with the creation of new chat rooms by users on yahoo messenger. I know creating a new table isn't very difficult though.
I am very green when it comes to javascript and ajax. I'm a lil intimidated actually. I understand the concept of ajax but dont really understand on how to call a database with it in conjunction with php.
RazorRamon
Junior Poster in Training
74 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
You won't be able to make a chat for php without ajax.
If you use jQuery, it should be quite easy.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080