dont_be_hasty Posted February 18, 2009 Share Posted February 18, 2009 Ok, so my webpage has 4 radio button they are: <input type="radio" name="id" value="???" checked> All <input type="radio" name="id" value="1"> 1 <input type="radio" name="id" value="2"> 2 <input type="radio" name="id" value="3"> 3 I then have a mysql query where i use the value selected from the radio box. But i need to know what value to i need put in the 'All' radio button (where the ? ? ? are) so that it can return results of any id (not just 1 or just 2, but can return 1, 2 and 3 altogether) Thanks Link to comment https://forums.phpfreaks.com/topic/145802-solved-radio-buttons-value-mysql/ Share on other sites More sharing options...
sc_84 Posted February 18, 2009 Share Posted February 18, 2009 You could set the value to "All" then run a different query based on which radio buttion is checked for example: if($id == "All"){ $query = "SELECT * from Table"; } else { $query = "SELECT * from Table where id = '$id'; } Link to comment https://forums.phpfreaks.com/topic/145802-solved-radio-buttons-value-mysql/#findComment-765508 Share on other sites More sharing options...
dont_be_hasty Posted February 18, 2009 Author Share Posted February 18, 2009 Worked perfectly Thank you! Link to comment https://forums.phpfreaks.com/topic/145802-solved-radio-buttons-value-mysql/#findComment-765521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.