JQuery Chat with PHP mySQL

Today I set myself the task of writing jQuery chat in less than half an hour. In the end, it took me 40 minutes.

However, I want to improve it, so downloading on the server and in the browser is not terrifying.

Currently, the user enters a text field, presses enter, this data is sent to the .php file, which updates the mySQL table and displays all the rows in the table.

There is a set interval on the div every two seconds to update if someone said something without pressing the enter button.

I just wanted to know thoughts on how to do it better, or the most effective way. I want to understand the best technologies to use and why.

Thanks for all your input, I love stack overflows, this is invaluable to me.

+5
source share
2 answers

Read this, I think it is very useful for you.

Creating AJAX Web Chat (Part 1) - PHP and MySQL

http://tutorialzine.com/2010/10/ajax-web-chat-php-mysql/

+3
source

Using an ajax poll for a chat application using the php back / javascript front technology stack will inevitably lead to a large server load. Http is simply not intended for such communication, and if you use apache (as I assume), there is really heavy overhead for each request.

As already mentioned in some of the above suggestions, you can explore the use of the full structure of the javascript stack (i.e. Node.js on the backend).

php backend Javascript ( ajax), XMPP. OpenFire, eJabberd - OpenFire . , , ~ 1000 -, ( Linux- ).

SO-, , , Ben Werdmuller @IBM , .

+1

All Articles