Not selecting value from drop down list

I have created a drop down list that displays values from mysql database.  The values are displayed but when a value is selected it no value is present.  Using html form.  Here is the drop down code:

echo "<select name=location value=''>Location</option>";
// printing the list box select command

while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[id]>$nt[location]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box


When I output Location in program that is called by form it is empty.
tpiccirilloAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobinSoftware EngineerCommented:
How does the html output look like?

Try surrounding the $nt[id] by (double) quotes.
0
quincydudeCommented:
If you have checked the generated source code and see no problem with the select and option (with correct option values) html code, the problem may be from your output program.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tpiccirilloAuthor Commented:
Out put program is working okay for other fields.  Just nothing in this field that is dynamically created.
0
RobinSoftware EngineerCommented:
Can you try to remove value part in the select tag and change it to:



echo "<select name=location>";
 
while($nt=mysql_fetch_array($result)){
  echo "<option value=$nt[id]>$nt[location]</option>";
}
echo "</select>";

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.