Hi I have a bit of a problem figuring this one out. I have a members table in a mysql database and a form to enter details of a new user. I have a set of checkboxes in the form called $interests, and there are six (ie. Government, People, Recreation etc).
The trouble is I can't figure out how to get the contents of these checkboxes into the database. I want it to enter all the checked values into the interests field in the database.
Here is what I have so far.....
include ("phpmodules/dbfuncs.inc");
$link = connectToDatabase();
if(!$link)
{
print "database connection error";
mysql_close($link);
exit();
}
// insert new member's details into members table
$query = "insert into members (loginname, password, password2, fname, lname, address, city, state, country, email, interests, question, answer) values (\"$loginname\",\"$password\",\"$password2\",\"$fname\",\"$lname\",\"$address\",\"$city\",\"$state\",\"$country\",\"$email\",\"$interests\",\"$question\",\"$answer\")";
$result = mysql_query($query);
mysql_close($link);