I have a radio button on my page which is not a required field. I was able to insert the data into MySQL if I select one of the Radio buttons. If I don’t select it and submit the page, I am getting “Internal server error occurred”. I couldn’t get the error message because the page is running on the production. It works fine on my development machine. Here is my code. Could you please let me know what could be the problem? Thank you.
<input type="radio" name="testRadio" value="radio1 value"> Radio 1
<input type="radio" name="testRadio" value="radio2 value"> Radio 2
Here is my PHP code to get the POST value
$radioVal = $_POST["testRadio"];
"INSERT INTO TABLE1(radio_coulmn) VALUES ('" .$radioVal. "')";
1 Answer