The code below is supposed to display a dropdown option box with the information in the table series that has the information in the series column ... of course it is not working any help would be great thank you. ALSO: my connection to the db is fine the problem is in the source below somewhere <?php $result = mysql_query("SELECT series FROM series"); print "<select name=series> \n"; print "<option></option>"; while($row = mysql_fetch_assoc($result)) { print "<option value = $row[series]</option> \n"; } print "</select> \n"; ?> Code (markup):
Try replacing: print "<option value = $row[series]</option> \n"; PHP: With print "<option value=\"{$row['series']}\">{$row['series']}</option> \n"; PHP: If that doesn't work, please paste the entire HTML output as sometimes MySQL Errors are within the <select>, so aren't displayed. Jay
Okay I replaced my code with your suggestion above and the html output is: <select name=series> <option></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> <option value=""></option> </select> Code (markup): Its also displaying the correct number of options they are just empty?! if I just echo whats in the mySQL table it displays fine but trying to get it into the dropdown seems to be very irritating
Really? It should just dump $row, not into a <option> or anything. Thanks for the rep. and let me know if you need anything Jay
I added before the while($row ... so i assume somewhere else in my page row is used and never released. Np rep definatly deserved thank you again