Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:48:36+00:00 2026-06-12T17:48:36+00:00

I have an absolute beginner question here. I’m having trouble getting multiple checkbox entries

  • 0

I have an absolute beginner question here. I’m having trouble getting multiple checkbox entries into a single column in my database. I’ve tried a few different things with my php but can’t seem to get anything to work properly. I’ve tried using serialize as well as looked into using implode/explode. Sorry I’m basically asking to be spoon-fed because I know its a simple fix, I just haven’t been able to get anything to work yet. Any assistance would be appreciated. THANKS!!! Also The three checkboxes I have are system, comm, and other and I do have the brackets for my 3 inputs even though the php isn’t setup to handle them yet, so for now my DB is still showing Array for these inputs. Here is my php

    <?php
$con = mysql_connect("localhost","Andrew","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("mydb", $con);

$sql="INSERT INTO persons (firstname, lastname, modelid, system, department, comm,  other, shift, comments)
VALUES
  ('$_POST[firstname]','$_POST[lastname]','$_POST[modelid]','$_POST[system]','$_POST[departme    nt]','$_POST[comm]','$_POST[other]','$_POST[shift]','$_POST[comments]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";

mysql_close($con);
?> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:48:39+00:00Added an answer on June 12, 2026 at 5:48 pm

    So here is what I have used to get my multiple entries into a single cell in my db

    ('$_POST[firstname]','$_POST[lastname]','$_POST[modelid]','". implode(",", $_POST['system']) ."','$_POST[department]','". implode(",", $_POST['comm']) ."','". implode(",", $_POST['other']) ."','$_POST[shift]','$_POST[comments]')";

    So maybe this will serve someone in the future who is trying to accomplish this same simple goal, now my only problem is that the entries in the db are being cut off, I believe the solution is to serialize my arrays. THANKS AGAIN for all of your assistance!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Absolute beginner question here. I have two lists in mathematica. The first one was
Absolute beginner question: I have a template file index.html that looks like this: ...
Another absolute beginner here...I have built a page that geolocates the user and places
I am absolute beginner to drupal. I have added a contact form (using Webform
I realize that this is a question that will probably not have a single
I'm working on ruby on rails and i'm an absolute beginner. My question is:
I am an absolute beginner in this field. I have written the following code
Hi I have a general question about Lists in C#. Here is my Code:
I am new to Javascript and development in general and have an absolute beginner's
I'm absolute beginner in web technologies. I know that my question is very simple,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.