I currently have a form that retrieves information from a mysql database.
This form can also be used to update information.
I can get the text box information out no problem.
But I can not retrieve the following and I do not want to convert them to a text box.
I have tried putting value=$whatever into them but none worked
1) How do I return the value from the database into the following
This holds the location of a file.
<input type="file" size="60" name="find_file">
I need to maintain this input type as the file location may change.
2) How do I return the value from the database into the following
<textarea name="comments" rows="8" cols="40"></textarea>
3)How do I return the value from the database into the following dropdown list.
Again this value may need to be changed.
<?php
$db = mysql_connect("localhost", "root", "" or die ('Cannot connect to database');
mysql_select_db("data",$db) or die ('database not available');
$sql='SELECT * FROM Names';
$result = mysql_query($sql,$db);
echo "<select name=first>\n";
while ($row = mysql_fetch_array($result)) {
echo "<option value=$row[0]>$row[0]</option>\n";
}
echo "</select>\n";
?>
Thanking you for any help received
This form can also be used to update information.
I can get the text box information out no problem.
But I can not retrieve the following and I do not want to convert them to a text box.
I have tried putting value=$whatever into them but none worked
1) How do I return the value from the database into the following
This holds the location of a file.
<input type="file" size="60" name="find_file">
I need to maintain this input type as the file location may change.
2) How do I return the value from the database into the following
<textarea name="comments" rows="8" cols="40"></textarea>
3)How do I return the value from the database into the following dropdown list.
Again this value may need to be changed.
<?php
$db = mysql_connect("localhost", "root", "" or die ('Cannot connect to database');
mysql_select_db("data",$db) or die ('database not available');
$sql='SELECT * FROM Names';
$result = mysql_query($sql,$db);
echo "<select name=first>\n";
while ($row = mysql_fetch_array($result)) {
echo "<option value=$row[0]>$row[0]</option>\n";
}
echo "</select>\n";
?>
Thanking you for any help received