1

My apologies in advance as this may be lengthy.

I'm trying to determine if what I need is socket programming or some other technology.

  • I have a web site/app that acts as a dashboard.
  • I have a database that holds the data for the web app.
  • I have a script to retrieve data and insert it into the database.

What I'd like to do is have the web app automatically update as new data is inserted into the database. My limited understanding leads me to believe that socket programming could accomplish this but I can't find answers to my questions (perhaps because I don't know where to look).

So, with that said, here are my questions:

  • Can socket programming with PHP accomplish this?
  • Can the server that hosts the web app and database be the socket server and client?

Any resources that you could direct me to would be great and much appreciated. I've read the basics on php.net and a few blog posts but nothing very in depth.

2

1 Answer 1

1

You should avoid opening a second custom socket in a webapp. Since it requires you to set up port forwarding and firewall rules to get it running.

You should look for WebSocket, polling or long-polling.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.