With our data imported into the database we can start exploring some of the escudos statements we can
integrate with my esc.
Well I.
To perform different tasks we'll start off with the select statement.
We've worked with this one before and p my admin is select statement we'll retrieve data from the database
first create and save a new HP file in your text editor.
We've named ours select dot BHP establish a connection to my Web site database as we did in the last
lesson
next we need to create our Eskew statement here.
We've set the Eskimo statement to select the I.D. First Name Last Name and Email columns from the user's
table
we then execute the ESC will query and put the resulting data into a variable called result
the following if statement checks to make sure there are more than zero rows if there are zero rows
it means there is no data relevant to our query in which case the words zero results will be output
at if there are more than zero rows this function will put all the results in an associate of array
that we can loop through the while loop loops through the results set and outputs the data from the
columns we specified in the SELECT statement so I d First Name Last Name Email in date
the output is done through a basic echo statement so you can see that we have our echo statement and
an item label and then the data next to it.
You can see the result in your web browser by loading this page using the local post you URL so you
can see we have the I.D. and then that's the data from the database we have the name label and then
the first and last name from the database in the email so it loops through every single one and outputs
all the data from the database.