Using what we've learned so far.
We can create an array in HP that contains several items each one of those being an array itself containing
two items a title and some content using strings as indexes like this.
We can then end the p-h P and start an h e mail document give it a header and title then body section
with a header and main section inside the main section.
We can create the list and use p h.
P to loop around the array of article data and display the details of each article like that.
When we view this in a browser we get a list of articles just like you Max see on a blog.
So without editing the h.t. EMAIL code down here we can add a new article to the erate up here
and then in the browser we get updated.
It's chamoun So we have a dynamic content on our website.
However we've still got this data hard coded in this script so to update this page in the browser we'd
need to edit this file.
This is far from ideal as only one person could do it at once and whoever is editing the code would
need to know.
P.
The better solution is to have the data stored separately from the script that's displaying it then
the script can retrieve that data from storage process it and display it.
If we want to update the website all we need to do is update the data and the website will be updated
after Mattingly.
So where do we store this data.
We could store it in a text file for example.
Then the script could read this file.
However accessing files from scripts can be slow and we can have problems.
If someone is trying to edit the file at the same time as the script is trying to read it much better
to use a database.
A database is a structured set of data Argan ised so that it can be easily accessed and updated.
We administer databases using a database management system.
These are designed to allow fast concurrent access to data in addition to giving us features like easy
maintenance security and so on.
So in this section will learn about how to create a database how to access it using P H.
P and will change the script.
We just wrote to get data from the database instead of being hard coded in the script.