I’m trying to create a web page in PHP and HTML so that I can read data from a database and automatically publish it to a web page.
What this web page would need to do is read information already stored in a MySQL database and put it on a web page, without the user needing to physically refresh the web page.
I have another script that reads information from another website’s API and puts that information into a MySQL database. I want this new web page to be able to publish content as the other script collects information and inputs it – as the MySQL server is updated.
I am assuming that this would require JavaScript, am I right?
Yes, what you are looking for is called AJAX. Many javascript libraries including jQuery have excellent support for AJAX.
In a nutshell, javascript makes a http request and returns it into a javascript variable where you can do anything you’d like with it.
For MySQL information, you’d probably want to return JSON from the ajax request. jQuery will automatically parse the JSON and convert it into an array/object – thus making it easy to iterate through “rows” and display your information.
I’d recommend taking some jQuery tutorials. When you get a basic understanding, take a look at this jquery AJAX tutorial:
http://viralpatel.net/blogs/2009/04/jquery-ajax-tutorial-example-ajax-jquery-development.html
Once you get the concept, then you can do a javascript setInterval to run the ajax call to automatically check if the database has been updated or not every so often.