Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.