Jump to content

Check box storing values to mysql >help please


Roach

Recommended Posts

Hi I am sorry if this has already been discussed, I cant seem to find it on the boards.....

 

anyway I have a settings script that saves settings to my config table. I am trying to add a checkbox so I can get a t (true) or f (false) for later referance.

 

The scripting I am trying to place it in is:

 

'items'          => array (

                array (

                        'type'          => 'checkbox',

                        'name'          => 'my_stuff',

                        'text'          => $strMystuff

                      ),

 

all ather variables in other arrays are stored as such:

 

if (isset($this_thingl))

        SettingsWriteAdd('this_thing', $this_thingl);

    if (isset($the_other))

        SettingsWriteAdd('the_other', $the_other);

 

Now I have the checkbox on the page all I need to do is have a:

if (isset($my_stuff))

        SettingsWriteAdd('my_stuff', $what goes here?????);

 

How do i get a checked or not checked and save without a lot more complicated scripting ?

Please forgive my ignorance, any help appreciated

 

Would it possible be easier if I had to check boxes: line on and off ?

if so how would I tell php if one or another was checked ?

like

if (isset($my_stuff))

        SettingsWriteAdd('$my_stuff', 'checked');

if (isset($my_other_stuff))

        SettingsWriteAdd('my_other_stuff', 'checked');

 

seems like that would be pre defining my_stuff and my_other_stuff as checked allready wouldnt it ?

not to mention how to tell if box is actually checked ?

 

Maybe I am kicking a dead cat ? can anyone think of an easier way of adding options (a or b) within the scripting I have other than a check box ?

 

 

Thanks again,

Rochelle

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.