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
https://forums.phpfreaks.com/topic/152353-solved-select-from-where-problem/
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.

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.