I am trying to make a dropdown menu in an html form that relies on information in a databse. This is the code I have:
$rows=query("SELECT Symbol FROM Portfolio WHERE id= ?", $_SESSION["id"]); This part definitely works. AB is angled bracket since this box will not let me type angle brackets.
(AB)form action="sell.php" method="post" (AB) (AB)fieldset(AB) (AB)div class="form-group"(AB) (AB)select name="Stock"(AB)
foreach($rows as $row) { print( '(AB)option value="$row["Symbol"]"(/AB) (AB)/option(AB)'); }
I've also tried the following for the second to last line of code:
echo '(AB)option value="' . $row["Symbol"] . '"(AB)/option(AB);
and numerous other variations on this theme. None of them really seem to work. My dropdown menu has no options; when clicked, it displays a blank space. I'm confused as to why this printing html doesn't seem to work here when it worked previously while making a table with print(""); etc.