How can I create real-time chat PHP / MySQL?

I want to learn how to make one of these systems from scratch, and I find many unwanted links on Google. I just want a simple tutorial for most basic PHP and MySQL chats, so I can understand the concept before I start messing around with jQuery / AJAX.

+3
source share
5 answers

PHP / MySQL Chat 101:

1) the user opens the browser
2) the user enters the address in brower
3) the browser sends an HTTP request
4) the server receives the HTTP request
5) the server tells the PHP interpreter to run the PHP script
6) the PHP script connects to the MySQL database
7) the PHP script receives list of messages
8) PHP generates an HTTP response from the HTML code with messages and form
9) The server sends an HTTP request to the browser
10) The browser draws HTML from the HTTP response
11) The user enters a new message and sends the form
12) The browser sends an HTTP request Post
thirteen)...

+6

- , , . , .

, .

, , , , , AJAX. AJAX , .

+3

id | user | timestamp | message

PHP, AJAX .

, , - . , , 100 ( ).

Ajax ( JSON), , JQuery.

+2

php mySQL , . , , , 100 . 1000 , 100 ( ). mySQL . , .

, redis (facebook memcacheD).

, php , , node.js

0
source

Source: https://habr.com/ru/post/1783586/


All Articles