Jump to content

[SOLVED] select from where problem


kev wood

Recommended Posts

i am trying to select only a few values from a column depending on the selection from a drop down menu.

 

what i want to be able to do is have the user select a title from a drop down menu which is populated from a mysql db.  then once the selection has been made the user the goes to the next page where all the people's email address will be displayed who registered interest in the chosen subject from the drop down menu.

 

at the minute my code is not exactly write as it is looking for a column with the value from the drop down menu.

 

here is what i have so far

 

$query="SELECT id, title FROM training WHERE 'housing'=$a";

 

what this line should be doing (which it does not) is select the id and title from the training table but only select the the rows which have the value of a in the housing column.

 

hope i have made myself clear if not i will try to explain better.

Link to comment
Share on other sites

yes thanks for the reply.  i didnt need to do it in that way in the end.  i needed it to work so i could see which option people had selected for the 1, 2, and 3 and not put all the email address in the one box.

 

thanks for the reply anyway.

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.