Displaying SQL data in HTML form
<p>I wrote following code in PHP to get the details from the mysql table but I dont know how to display them in HTML form.</p>

<pre><code>&lt;?php
$servername = "localhost";
$username = "root";
$password = "icsk";
$dbname = "yusuf";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn-&gt;connect_error) {
    die("Connection failed: " . $conn-&gt;connect_error);
} 

$sql = "SELECT dsl, Fname, Lname, Cid, pack FROM homereg";
$result = $conn-&gt;query($sql);

if ($result-&gt;num_rows &gt; 0) {
    // output data of each row
    while($row = $result-&gt;fetch_assoc()) {
        echo  $row['dsl']. " " . $row['Fname']. " " . $row['Lname']. " " . $row['cid']. " " . $row['pack'] ."&lt;br&gt;";
    }
} else {
    echo "0 results";
}
$conn-&gt;close();
?&gt;
</code></pre>

<p>The above code displays the data on the webpage with the help of echo but i want it to be displayed in form. 
HTML form has following code:</p>

<pre><code>&lt;form method="POST" name = "frm" action="homerenew.php"&gt;

    &lt;div align="center"&gt;
        &lt;table border="1" width="425"&gt;
            &lt;tr&gt;
                &lt;td width="223"&gt;&lt;font face="Georgia"&gt;&lt;b&gt;Subscription Number&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
                &lt;td width="186"&gt;&lt;input type="text" name="T1" size="20"&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td width="223"&gt;&lt;font face="Georgia"&gt;&lt;b&gt;Your Current Pack&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
                &lt;td width="186"&gt;&lt;input type="text" name="T2" size="20"&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td width="223"&gt;&lt;font face="Georgia"&gt;&lt;b&gt;Renewal Options&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
                &lt;td width="186"&gt;&lt;select size="1" name="D1"&gt;
                &lt;option value = "1 Month"&gt;1 Month&lt;/option&gt;
                &lt;option value = "2 Months"&gt;6 Months&lt;/option&gt;
                &lt;option value = "1 Year&gt;1 Year&lt;/option&gt;
                &lt;/select&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td width="223"&gt;&lt;font face="Georgia"&gt;&lt;b&gt;Balance Payable&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
                &lt;td width="186"&gt;&lt;input type="text" name="T3" size="20"&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;
    &lt;p align="center"&gt;&lt;input type="submit" value="Renew" name="B1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
    &lt;input type="reset" value="Reset" name="B2"&gt;&lt;/p&gt;
&lt;/form&gt;
</code></pre>

<p>I am new to PHP connectivity that is why little confused. Help will be greatly appreciated. Thank you</p>