Jump to content

Insert checkboxes data


Julian

Recommended Posts

Hello guys.  I've been looking around and I did not find a solution for my current situation.  Here's my question,  I want to insert a new record for each checkbox that had been checked on a specific table. (`profile`)

 

Checkboxes are created dynamically from another table (`categories`).  Here's code example:

 

mysql_query("INSERT INTO profile (user_id, user_category) VALUES ($user_id, $(checked boxes);

//Checked boxes

<?php while ($row_cat = mysql_fetch_assoc($cat)) {
             echo '<td><input name="user_category" type="checkbox" id="user_category" value="1" /></td>';
      } ?>

Link to comment
https://forums.phpfreaks.com/topic/161370-insert-checkboxes-data/
Share on other sites

Here's my question,  I want to insert a new record for each checkbox that had been checked on a specific table. (`profile`)

 

Checkboxes are created dynamically from another table (`categories`).

 

That's not a question...

 

You're not helping sir.

 

Thanks jxrd for the help..

 

Can you `code` explain it.  How to break the array in order to insert each one as a new record...

 

Regards

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.