urban Posted October 14, 2008 Share Posted October 14, 2008 this is my code <form action="upload.php" method="POST" ENCTYPE="multipart/form-data"> New Album name: <input type="text" name="album_name" size="10"> or choose an existing album <?php ///start the drop down box query $query="SELECT distinct album_name FROM photo WHERE id_user = '".$_SESSION["login"]."'"; $result = mysql_query ($query); echo "<select name=add_to_album value=''>My album</option>"; // printing the list box select command echo "<option value=>Choose an Album"; while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option value=$nt[album_name]>$nt[album_name]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> And if i have "sherwood Pines" say in the "add_to_album" drop down list when i submit the data to the upload.php it will only echo "sherwood" the pines will not be there. Could you have a look to see what i have done wrong thanks Link to comment https://forums.phpfreaks.com/topic/128337-populating-a-form-list-problem/ Share on other sites More sharing options...
urban Posted October 14, 2008 Author Share Posted October 14, 2008 I have sorted it thanks now i got missing ' echo "<option value='$nt[album_name]'>$nt[album_name]</option>"; Link to comment https://forums.phpfreaks.com/topic/128337-populating-a-form-list-problem/#findComment-664812 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.