0

Hi, I am having some trouble echoing into a drop down menu. Instead of the bandnames that I would like to appear, $band is appearing. Here is my code:

<form action="insert.php" method="post">
Band Name <select name="band">
<? $link = mysql_connect(); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
mysql_select_db(); 



    $result = mysql_query("SELECT * FROM bands WHERE Username='$username'");  
 
 
    while($row = mysql_fetch_array($result)) 
    { 
        $band = $row['BandName'] ;
echo '<option value=\"$band\">$band</option>' ;
    }

?>
</select>

I think it may be something to do with putting . $band . or maybe using '$band' as that is what I have seen but these don't seem to be working for me, so I am either way off or making little mistakes.

Any help would be greatly appreciated.

Thanks

2
Contributors
2
Replies
7
Views
5 Years
Discussion Span
Last Post by gilgil2
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.