Now we have our database class.
Let's use it here in the index page.
We're using the my esky Well I procedural code we developed earlier to select the list of articles.
Let's change this step by step.
To use pto first will require the Database class file replacing the database include that contains the
my Eskew elhai connection function
then we'll create a new database object and then change this Carl to get the connection by calling the
method in the class instead.
The equivalent of the my esky Well I'd query function is to call the query method on the pto object
so let's change that.
Passing in this key well.
As with the my Eskew a function this returns false.
If there's an error to get to every detail we call the error info method which returns an array.
So we'll just dump out the whole thing for now.
Then the PD or equivalent of the my esky Well I fetch.
I'll function
is the fetch method on the resultset ASC within my escudo life function.
If we want just an associative array returned we have to pass in the fetch SAQ constant like that.
The code that processes the associative array is exactly the same looping around the array and printing
out the values.
And when we run this code in the browser nothing has changed except that now we're using pto instead
of my desk ally.