Displaying Users at the User Registration Website
Introduction.
Now that we have been able to add some users we want to be able to display
them. This will be based on a SELECT command in SQL. You
should also notice the abundance of similarities between this page and the
preceding page where we used an INSERT command to write to the
yourlastname_user_registration table. For this application we require only a single page which should be called display_user_registration.jsp. |
<html> <head> <title>Retrieving from a Table in MySQL and Displaying Using JSP</title> </head> <%@ page import = "java.sql.*" %> <% String php_display; String jsp_display; String mysql_display; // assign the values for database access try {
}
} |
After this page is uploaded and accessed you should see something like the following. |
Notice the processing that needs to be done to get the
PHP, JSP and MySQL interests to display. Notice how I bounced between HTML and JSP to create the table. The loops are in JSP, the actual printing of the database values are in JSP, but the table structure is in HTML. You should also make sure to notice the patterns from the write_to_user_registration.jsp that are repeated in this JSP. |