<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>Application Feedback Test</title>
		
		
		<style>

            table,th,tr,td
            {
                border: 1px solid black;
            }

        </style>

		
		
    </head>
    <body>
        <?php
			// php populate html table from mysql database
            $hostname = "";
            $username = "root";
            $password = "nz2@z5Wv";
            $databaseName = "feedback_application";
            
			// connect to mysql
            $connect = mysqli_connect($hostname, $username, $password, $databaseName);
			
			// mysql select query
            $query = "SELECT * from tb_cform";
            
			// result for method one
			$result1 = mysqli_query($connect, $query);

			// result for method two 
			$result2 = mysqli_query($connect, $query);

			$dataRow = "";

			while($row2 = mysqli_fetch_array($result2))
			{
				$dataRow = $dataRow."<tr><td>$row2[0]</td><td>$row2[1]</td><td>$row2[2]</td><td>$row2[3]</td></tr>";
			}
        ?>
        
        <!-- Table One -->
        <table style="background-color: red;">

            <tr>
                <th>ID</th>
                <th>Timestamp</th>
                <th>Full Name</th>
                <th>Company</th>
                <th>Email Address</th>
                <th>Telephone</th>
                <th>Application</th>
                <th>Reason</th>
                <th>Comments</th>
                <th>Status</th>
            </tr>

            <?php while($row1 = mysqli_fetch_array($result1)):;?>
            <tr>
                <td><?php echo $row1[0];?></td>
                <td><?php echo $row1[1];?></td>
                <td><?php echo $row1[2];?></td>
                <td><?php echo $row1[3];?></td>
                <td><?php echo $row1[4];?></td>
                <td><?php echo $row1[5];?></td>
                <td><?php echo $row1[6];?></td>
                <td><?php echo $row1[7];?></td>
                <td><?php echo $row1[8];?></td>
                <td><?php echo $row1[9];?></td>
            </tr>
            <?php endwhile;?>

        </table>

    </body>
</html>
