Hi,
I have reviewed all articles on this site regarding php, mysql, and arrays but I still can not get info from an array into mysql database. I don't know if I have the database set up properly to receive the info.
Here is the scenario:
<input type="checkbox" name="visitor_profession[0]">
I have six of these possible choices for profession. They can be 1 or more of these choices.
The following is the code I am trying to use to get the array choices into the database:
<?php
{
if($value == "on")
{
db_query("INSERT visitor_profession ".
"($ID, $value) ");
}
}
?>
What results in the database under visitor_profession is simply the word array.
How do I submit the specific info(which number in the array was checked)?
Why is it necessary to have $ID if the form data already includes a name?
ID is the primary key in my database but I'm not understanding the meaning of:
($ID, $value)
Please help me if you can. I am truly learning by trial and many errors.
Thanks,
Debra