How can I make a chat with PHP and MySQL only, without any other language? I googled for a while, but all the solutions I found needed PHP+MySQL+AJAX/JS/jQuery. In order to keep my code as simple as possible, I’d like to only use those two languages (because idk ajax not js not jquery, LOL.). Any suggestion? I thought about making temporary records where to record the chats, but it would be way too slow, since it would require many queries. Any solution?
Share
I think any solution would be too slow in this case.
See, the core nature of chat is real-time (or close to) updating: you’d want to see the message written by someone as fast as possible (if not, it’s a forum territory, not chat). There are several methods of dealing with this problem, but they all involve JavaScript (as you need to update the page shown to your users).
Of course, you might make your page auto-refreshing (with
meta http-equiv="refresh"), but it would drastically increase the load on your server – and it will still behave like a forum, just on the ‘refresh steroids’. )