I want to have multiple checkbox values be stored into one field in a database. (Ex. 1, 24,56,100). I am wanting to know how I can make this happen, and how does PHP read thes
first create database:
create table employee(id int(10) not null, name varchar(20), hobbie varchar(20),
worked varchar(20), primary key(id));
after that create an html page like that:
Untitled Document
after that we have do mysql connect.php
after that we have to create an check.php like that ok
You didn't select any any hobby.\n");
}
else
{
$N = count($hobb);
echo("You selected $N Hobbies(s): ");
for($i=0; $i < $N; $i++)
{
$var1=$hobb[$i];
include ('connect.php');
$table = "INSERT INTO employee (name, hobbies, worked) ".
"VALUES ('$name', '$var1', '$worked')";
mysql_query($table) or die(mysql_error());
$inserted_fid = mysql_insert_id();
mysql_close();
}
echo "successfully uploaded!..";
}
}
else
{
echo "error please check ur code";
}