0

Hi this is code to display the list of values with an checboxes
now i want to store the values selected into database. i want the php tag how to store the array of values which have been selected pls help me out..............

    $result = mysql_query("SELECT * FROM  service_type ");
    while($row = mysql_fetch_array($result))
            {
            ?><input type="Checkbox" name="b[]"  value=""> <?echo $row['servicet'];
            echo "<br />";

            }
        }

Edited by Dani: Formatting fixed

5
Contributors
9
Replies
10
Views
9 Years
Discussion Span
Last Post by nav33n
0

No just it should be possible to store the selected list of values in db .........thats it

0

You have to create database fields with checkbox names..and update that field with 1,if the check box is checked...

0

This is very simple, try this.....

foreach($b as $value){
mysql_query("insert into ur_nxt_tab values($value,...)") or die(mysql_error());
}

but keep in mind the value insertion field must be the first field in your table

0

Hi i am getting this error..........for these statements
$servicec = implode(",",$_POST);
$servicet = implode(",",$_POST);
$services = implode(",",$_POST);
Warning: implode() [function.implode]: Invalid arguments passed in

0

a,b ,c are the arrays........
$servicec = implode(",",$_POST);
$servicet = implode(",",$_POST);
$services = implode(",",$_POST);

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.