PHP和SQL基本即时消息[关闭]

I am thinking of creating a simple web based instant messaging using a combination of PHP and SQL. To keep it simple I was thinking of not sending the message to the other clients browser using COMET or AJAX, but simply uploading it to a SQL database. The other clients computer will then periodically refresh the webpage which will cause the PHP code on the server to check for and return any new messages.

Would this method be simply to slow to be actually useful? Thanks in advance :)

That depends on the scope of your project. If you're thinking of server a thousand users, this is not a recommended method. If you want to chat with your 5 colleagues on an internal LAN: it doesn't really matter much. It will be fast and work just fine.

You could also consider building it with jQuery + PHP + SQL though; read up on jQuery a bit and you'll be amazed by the power of its AJAX functions.

Also, if you're lazy or simple don't have enough time, use a premade library like this one here and i'm sure there are many more to be found on the internet.