Lemme explain you what really I want?
My database Structure includes:
Database: petp
Table : Task
Attributes: list of task,Assigned to,Start Date,End Date,Completion Percent
Now I have created a webpage called pro32.php in which I have the following code:
File : pro32.php
<html>
<body>
<form name="form1" method="post" action="retrieve.php">
<p>Select Project
<select name="Project">
<option value="uone">uone</option>
<option value="psa">PSA</option>
<option value="gice">gice</option>
<option value="dice">dice</option>
</select>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
The above code is manually entered Right??
What I want is the drop-down list should take inputs from database.
I tried writing few code but failed to make it work.
Here my trial:
<table align="center" cellpadding=1 border=1 width="70%">
<tr>
<td width=75%><b><font face=arial size=2><input Type="radio" name="optEngineers" value="ListOption" checked>Engineers</font></b></td>
<td > <Select Name ="cmbFixedBy" size="1" >
<Option value="NULL"> </option>
<?php
$con = mysql_connect("localhost","root","mysql123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT Project,List,Assigned,Start,End,Completion
FROM task");
while($row = mysql_fetch_array($result))
{
<option value=". $row['Project'] "> </option>
<option value=". $row['List'] "> </option>
<option value=". $row['Assigned'] "> </option>
<option value=". $row['Start'] "> </option>
<option value=". $row['End'] "> </option>
<option value=". $row['Completion'] "> </option>
}
mysql_close($con);
?>
</td>
</tr>
Can you pliz help me with this??