View difference between Paste ID: QiPgYRqC and mc38B2Gq
SHOW: | | - or go back to the newest paste.
1
<form action="sell.php" method="post">
2
    <fieldset>
3
        <div class="form-group">
4-
        Stock:
4+
            Stock:
5-
        <?php 
5+
6-
        $rows = query("SELECT symbol FROM portfolio WHERE id = ?", $_SESSION["id"])
6+
	    // stocks is an array passed through render from the controler with the symbol of every stock		
7-
        foreach($rows as $row)
7+
            <?php foreach($stocks as $stock):?>
8-
        ?>
8+
                    <option value = <?= $stock ?>> </option>             
9
        </div>
10-
                <option> value = <?= $row["symbol"] ?> </option>             
10+
11-
            </div>
11+
12
</form>