单选按钮未将值发布到 MySQL 数据库 [英] Radio button not posting value to MySQL database

查看:52
本文介绍了单选按钮未将值发布到 MySQL 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单正在由 PHP 更新为 MySQL 数据库.我有两个单选按钮:

I have a form that is being updated by PHP to a MySQL database. I have two radio buttons:

<input type="radio" name="show_on_website" value="Y" /> Yes
<input type="radio" name="show_on_website" value="N" /> No

点击单选按钮并提交表单后,Y或N值(取决于所选的值)不会提交到MySQL数据库中.表单中的所有其他数据都可以正常更新,只是单选按钮不是.我在提交表单时使用 $show_on_website = $POST['show_on_website'];.

Upon clicking on the Yes or No radio button and submitting the form, the value Y or N, depending on which is selected does not get submitted into the MySQL database. All other data within the form is updating fine, just not the radio buttons. I am using $show_on_website = $POST['show_on_website']; upon submitting the form.

我错过了什么或做错了什么?感谢您提供的任何帮助.

What am I missing or doing wrong? Thanks for any help you may provided.

推荐答案

使用 $_POST 而不是 $POST

这篇关于单选按钮未将值发布到 MySQL 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆