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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.