Jump to content

Populating a form list problem


urban

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.