I have a drop down menu which reads from category table all the different product categories. My problem is even though on the drop down menu I see full category names, in the text field where this is fed, words after the space is dropped.
Example on the drop down I see "video camera" on text area it shows "video". How can I show the full text?
Here is my code:
<form action="additem.php" method="GET">
<?
$db = mysql_connect "localhost", "root");
mysql_select_db("mycategory",$db);
$sql = "SELECT * FROM category";
$result = mysql_query($sql) or die("Couldn't execute query.");
// drop down
echo "<select name=category> ";
if ($myrow = mysql_fetch_array($result)) {
do {
echo "<option value=$myrow[category]>$myrow[category]</option>\n";
} while ($myrow = mysql_fetch_array($result));
echo "</select>";
}
?>
<input type="submit" name="Submit" value="category selection">
</form>
Category: <? echo "$category"; ?>