Display Records From MySQL table

In order to display records from MySQL table create DisplayRecord.php file as shown below:


<Title> Display Record</title>
<table border="1" >
<th>Customer Code</th>
<th>Customer Name</th>
<th>Customer City</th>
// Establish Connection with Database
$con = mysql_connect ("localhost","root");
// Select Database
mysql_select_db("DBDEMO", $con);
// specify the query to execute
$sql = "select * from Customer_Master";
// execute query
$result = mysql_query ($sql,$con);
// Loop through each records
while ($row = mysql_fetch_array($result))
$Code=$row ['CustomerCode'];
$Name=$row ['CustomerName'];
$City=$row ['City'];
<td><?php echo $Code;?></td>
<td><?php echo $Name;?></td>
<td><?php echo $City;?></td>
// Close the connection
mysql_close ($con);

Download Projects

Download Programs