Internship Projects Homework 4: PHP / MySql Integration
Internship Projects Homework 4:PHP / MySql Integration References See the files MySqlConnect.php, MySqlQuery.php,…
References. See the files MySqlConnect.php, MySqlQuery.php, and MySqlPretty.php as examples: http://10.10.0.20/~j_kazarian/php/phpExamples.zip Assignment in General Start with the three pages from Homework 3, namely the form, the splash page, and the validate page. Write an additional web page that inserts correct data into a MySql database. After insertion, display all of the values in an HTML Table. Details HTML Form and Splash Page This should work the same as in Homework 3. Validate Page. The validate page changes. Add a form with four hidden fields and a submit button at the bottom of the confirmation page. This will call the insert page. Insert Page. The insert page does several things: • Connects to MySql. • Inserts a row into the table. • Queries the entire table. • Prints the table as an HTML form. Specific Requirements. Form With Hidden Fields On the validate page, add a form with hidden fields to the confirmation message, for example:
<INPUT TYPE=HIDDEN NAME=Anun VALUE=”<?php echo $_POST[Anun] ?>”>
and a SUBMIT button to transfer the data from the validate page to the insert page. Remember, since this form is part of the confirmation message, the “invisible” form will not appear unless all data is correct.
Insert Page Add another PHP page that performs MySql database operations. First, connect to the database. Second, insert the data from the validate page into a table. Finally, query the resulting table and print its entire contents. Format the output as an HTML table, for example:
<table border="0">
<tbody>
<tr>
<th><!-- first column name --></th>
<th><!-- second column name --></th>
<!-- repeat for all columns --></tr>
</tbody></table>
</TR>
<TR>
<TD><!-- first row value for this column --></TD>
<!-- repeat for all columns -->
</TR>
<TR>
<TD><!-- second row value for this column --></TD>
<!-- repeat for all columns -->
</TD>
<!-- repeat for all remaining rows -->
</TABLE>
Hints. Hard code the column names. One PHP foreach statement will be useful for the <TD> row values. Use the MySql command line interface to create the data table. Build the project in stages: first, verify passing of data from the validate to the insert page. Second, connect to the database. Third, insert the data and use “ugly printing.” Finally, render the MySql data as and HTML table. The PHP print_r function is useful for debugging…
Source: http://leftbrainedgeeks.com/
Download Internship Projects Homework 4: PHP / MySql Integration
Leave a Reply