繁体   English   中英

无法以字符串形式插入单选按钮的MySQL DB值

[英]Cannot Insert into MySQL DB Value of Radio Button as String

语言:OO PHP 5+ DB:MySQL

我试图通过获取单选按钮的值从表单中插入数据,然后将其插入到MySQL数据库中。 我可以在使用文本字段收集数据的表单上插入任何内容,但是当我尝试插入单选按钮的值时,插入只会将相应的db字段留空。 我将其用作我的Insert语句中的参数(这些字段在类的顶部分配):

$this -> myTextfield // this works
 $this -> myRadioButtonValue // this doesn't seem to grab the value as it inserts a blank entry. 

非常感谢帮助。

GF

确保为单选按钮指定了value属性,例如:

<input type="radio" name="somename" value="my value goes here !" />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM