From RuneGlory
Line 174: | Line 174: | ||
+ | </body> | ||
+ | </html> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | <?php | ||
+ | $con = mysql_connect("localhost","root","root"); | ||
+ | $db = mysql_select_db("Time_sheet",$con); | ||
+ | $get=mysql_query("SELECT Emp_id FROM Employee ORDER BY Emp_id ASC"); | ||
+ | $option = ''; | ||
+ | while($row = mysql_fetch_assoc($get)) | ||
+ | { | ||
+ | $option .= '<option value = "'.$row['Emp_id'].'">'.$row['Emp_id'].'</option>'; | ||
+ | } | ||
+ | ?> | ||
+ | <html> | ||
+ | <body> | ||
+ | <form> | ||
+ | <select> | ||
+ | <?php echo $option; ?> | ||
+ | </select> | ||
+ | </form> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 01:39, 20 May 2018
<?php
$con = mysql_connect("localhost","root","root");
$db = mysql_select_db("Time_sheet",$con); $get=mysql_query("SELECT Emp_id FROM Employee ORDER BY Emp_id ASC");
$option = ;
while($row = mysql_fetch_assoc($get))
{
$option .= '<option value = "'.$row['Emp_id'].'">'.$row['Emp_id'].'</option>';
} ?>