Professional Documents
Culture Documents
Topic 9 Homework Marking Guide
Topic 9 Homework Marking Guide
Topic 9 Homework Marking Guide
Task:
Write a php code that displays the data captured in the database on a browser in a tabular
form. [10 Marks]
The code for the form and its validation should be as follows:
<?php
$server=”localhost”;
$user="clientdata";
$password="password";
$database="suggestion";
$con = mysql_connect($server,$user,$password);
@mysql_select_db($database, $con) or die( " Could not establish the connection!");
echo "<td>";
echo($row["Email"] . " ");
echo "</td>";
echo "<td>";
echo($row["Gender"] . " ");
echo "</td>";
echo "<td>";
echo($row["Subject"] . " ");
echo "</td>";
echo "<td>";
echo($row["Suggestion"] . " ");
echo "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close ($con);
?>