output from checkboxes
Posted: Fri May 30, 2008 9:02 am
Hello
I have 12 checkboxes that I am trying to send to a mysql database. How can I get more than one of them to display in the database? Currently if more than one checkbox is checked only one of the boxes is being displayed in the database and I have the type in sql setup for text.
I have 12 checkboxes that I am trying to send to a mysql database. How can I get more than one of them to display in the database? Currently if more than one checkbox is checked only one of the boxes is being displayed in the database and I have the type in sql setup for text.
Code: Select all
if (isset($_POST['DEANAHSS2']))
$RSP = 'DEANAHSS2';
if (isset($_POST['PRES2']))
$RSP = 'PRES2';
if (isset($_POST['VPIT2']))
$RSP = 'VPIT2';
if (isset($_POST['DEANCNMS2']))
$RSP = 'DEANCNMS2';
if (isset($_POST['PROV2']))
$RSP = 'PROV2';
if (isset($_POST['VPRDGS2']))
$RSP = 'VPRDGS2';
if (isset($_POST['DEANCOEIT2']))
$RSP = 'DEANCOEIT2';
if (isset($_POST['VPAF2']))
$RSP = 'VPAF2';
if (isset($_POST['DEANERK']))
$RSP = 'DEANERK';
if (isset($_POST['VPDUE']))
$RSP = 'VPDUE';
if (isset($_POST['DEANUE2']))
$RSP = 'DEANUE2';
if (isset($_POST['VPIA2']))
$RSP = 'VPIA2';
$query = "INSERT INTO Log (DateRcvd, OrigDept, OrigContact, RespOffice, contents, refer, request, deadline, GivenTo, stats, outcome, notes, complete)
VALUES ('$drcvd', '$ODT', '$ocont', '$RSP', '$contents', '$REF', '$REQ', '$deadline', '$givento', '$status', '$outcome', '$notes', '$completed')";
$result = mysql_query($query);