views:

374

answers:

1

Language: OO PHP 5+ DB: MySQL

I am trying to insert data from a form using radio buttons by getting their value and then inserting into a MySQL database. I can insert anything on the form that uses a textfield to collect data, but when I try to insert the value of a radio button the insert just leaves the corresponding db field blank. I am using this for as a parameter in my Insert statement (these fields are assigned at the top of the class):

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

An help much appreciated.

GF

+1  A: 

Make sure that you have specified a value attribute for the radio button eg:

<input type="radio" name="somename" value="my value goes here !" />
Sarfraz
Yes I have done that. I can use this value and print it out to the screen, I just can't seem to insert it into the db.I know this is a simple syntax error but what it is I cannot see yet.
I fixed it. I had put a space between '$this' and '->'. Grrr!
@grungefreak1: that is good news anyways :)
Sarfraz