Hi All,
I am new to the site, and also to PHP and MySQL, so please go easy on me for asking what may be an obvious question for many.
I am wanting to store the data from a sign-up form in a MySQL DB, but I cannot get my head around handling an array, and inserting it into a single row.
What I can already do is to create, connect and input "text" and "radio" type data into the table, so you can safely ignore some of the more obvious problems like connectivity etc.
The HTML for the checkbox area of the form in below.
<input name="work_style[]" value="1" type="checkbox">1
<input name="work_style[]" value="2" type="checkbox">2
<input name="work_style[]" value="3" type="checkbox">3
<input name="work_style[]" value="4" type="checkbox">4
<input name="work_style[]" value="5" type="checkbox">5
<input name="work_style[]" value="6" type="checkbox">6
<input name="work_style[]" value="7" type="checkbox">7
<input name="work_style[]" value="8" type="checkbox">8
<input name="work_style[]" value="9" type="checkbox">9
<input name="work_style[]" value="10" type="checkbox">10
I already have code to insert the other form data in to the rows [below], but how would I incorporate adding the array to the database?
$query=mysql_query("insert into plus_signup(userid,password,email,f_name,l_name,work_type) values('$userid','$password','$email','$f_name','$l_name','$work_type')");
I have searched all over the net for an answer to this problem, and I couldn't find anything that really helped, so any advise would be gratefully recieved.
Cheers.