I'm trying to make a drop down list with the data of one of my columns...i'm wandering if the code below is doing that... (it doesn't work by the way) Thanks very much!
<select id="teamlist" name="teamlist">
<?php
$pdo = new PDO('mysql:host=localhost;dbname=clubresults', 'root', '12345678');
#Set Error Mode to ERRMODE_EXCEPTION.
$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $pdo->prepare('Select teamname from members');
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
echo "<option>$row</option>";
}
?>
</select>