fraser5002 Posted July 1, 2010 Share Posted July 1, 2010 Hi i have 2 radio buttons ( yes/no) in a group i would like to have a submit butotn that when pressed will update a field in my mysql database with either a 1 or a 0 dependant on which radio button is selected . How would i do this via PHP (or otherwise) Thanks Link to comment https://forums.phpfreaks.com/topic/206362-upload-radio-button-value-to-mysql-filed/ Share on other sites More sharing options...
scvinodkumar Posted July 1, 2010 Share Posted July 1, 2010 $radiobuttonvalue = $_POST['radiobuttonvalue']; $query = "update tablename set fieldname = '".$radiobuttonvalue."' where primaryfieldname=value"; consider, your form will be like this, <input type="radio" name="radiobuttonvalue" value="1">Y <input type="radio" name="radiobuttonvalue" value="0">N Link to comment https://forums.phpfreaks.com/topic/206362-upload-radio-button-value-to-mysql-filed/#findComment-1079574 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.