Matt G Posted August 15, 2012 Share Posted August 15, 2012 Hello everyone, I have dynamically created a series of radio buttons, with "Options" populated from mysql: e.g. "Option 1" radio button 1 (OK) radio button 2 (Maybe) radio button 3 (Eliminate) "Option 2" radio button 1 (OK) radio button 2 (Maybe) radio button 3 (Eliminate) Etc... I have created a javascript loop (to loop through the form)... I have also created a script and table to display the results dynamically.. However, I am having trouble querying the sql database to display the proper results.. HERE'S WHAT I NEED: When radio button 1 is selected, I need the query to grab the selected "Option" to be displayed/printed. When radio button 2 is selected, I need the query to grab the selected "option" and isolate it to be displayed/printed in a separate area(of the results page) But when radio 3 is selected, I need the query to not grab this "option".. This "option" should be hidden from the user on the results page! Im sure there must be a million ways to do this, but I cant find any articles that seem to help.. or maybe Im looking in the wrong place??! Please Help I would greatly appreciate it!! Sorry if this seems confusing and Thanks in advanced!!! Link to comment https://forums.phpfreaks.com/topic/267096-dynamically-printing-mysql-query-results-help/ Share on other sites More sharing options...
Matt G Posted August 15, 2012 Author Share Posted August 15, 2012 i can also send snippets of the code I have created if it helps!! Link to comment https://forums.phpfreaks.com/topic/267096-dynamically-printing-mysql-query-results-help/#findComment-1369566 Share on other sites More sharing options...
Matt G Posted August 15, 2012 Author Share Posted August 15, 2012 i can also send snippets of the code I have created if it helps!! //code $filterQuery = "SELECT * FROM table_2 INNER JOIN table_1 ON table_2.Option_Id=table_1.Option_Id where "; $list = split($filterList,","); $first = false; foreach( $list as $filter ) { if( $first ) { $filterQuery .= " WHERE AND "; } $filterQuery .= "table_1.Option_Category <> '" . $filter . "' AND table_1.Option_Type <> '" . $filter . "'"; $first = true; } $filterQuery .= ";"; $filterResults= mysql_query($filterQuery); $filter_row= mysql_fetch_assoc($filterResults); //code Im joining two tables on the same column and wish t eliminate the option category and or type IF third radio button is selected.. Link to comment https://forums.phpfreaks.com/topic/267096-dynamically-printing-mysql-query-results-help/#findComment-1369577 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.