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 7445771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:06:49+00:00 2026-05-29T12:06:49+00:00

I have a problem inserting the values from checkboxes in an html document into

  • 0

I have a problem inserting the values from checkboxes in an html document into a database as a comma separated string (I know this is usually considered being bad style but in this case that is what is required).

I have an code snippet of the html file here

<div id="page16" class="page">
            <p style="font-weight: bold; width: 55%;"><a id="q16_qtext">*</a></p>
            <p style="font-style: italic;">Vælg venligst de (højst) 3 primære årsager (i alt).</p>
            <p style="font-style: italic;">Af økonomiske årsager:</p>
            <input type="checkbox" name="q16[]" value="1" id="num161">For dyrt i forhold til udbyttet for eleverne<br>
            <input type="checkbox" name="q16[]" value="2" id="num162">For dyrt i forhold til andre omkostninger (bøger, efteruddannelse af lærere osv.)<br>
            <input type="checkbox" name="q16[]" value="4" id="num164">Andre økonomiske årsager<br>
            <p style="font-style: italic;">Andre årsager:</p>
            <input type="checkbox" name="q16[]" value="5" id="num165">Pga. skolesammenlægning eller en anden større ændring<br>
            <input type="checkbox" name="q16[]" value="6" id="num166">Skolen havde/har ikke bemanding til det<br>
            <input type="checkbox" name="q16[]" value="7" id="num167">Der var for tidskrævende i forhold til udbyttet (for eleverne i forhold til pensum)<br>
            <input type="checkbox" name="q16[]" value="8" id="num168">Der var ikke længere opbakning til det i skoleledelsen (ikke økonomisk)<br>
            <input type="checkbox" name="q16[]" value="9" id="num169">Der var ikke længere opbakning til det blandt lærerne<br>
            <input type="checkbox" name="q16[]" value="10" id="num1610">Der var ikke længere opbakning til det blandt elever/forældre<br>
            <input type="checkbox" name="q16[]" value="11" id="num1611">Andet.&nbsp;&nbsp;&nbsp;&nbsp; Angiv i så fald primært hvad: &nbsp;&nbsp;<a style="text-align: center;"></a><input type="text" name="q16extra" value="" id="num89"><br>
            <input type="checkbox" name="q16[]" value="12" id="num1612">Ved ikke<br>
            <p style="bottom:5px;"><input style="width: 150px; height: 30px;" type="button" class="all" id="B19" value="tilbage" onClick="showPreviousLayer()"><input style="width: 150px; height: 30px;" type="button" class="all" id="C20" value="fortsæt" onClick="checkAnswersSixteen()"></p>    
        </div>

Then I connect to a database and use this piece of php code to create an array of the values

$q16 = implode(",",$_POST['q16[]']);

And then insert into “table” with the columns and values. There are of course many other columns and values to be inserted and these work! so the problem seems not to be with the insert statement but with the implode method perhaps.

i tried doing an echo($q16);
but that seems just to be empty.

Anyone who knows what the problem might be? please let me know if you need any other information 🙂

  • 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-05-29T12:06:50+00:00Added an answer on May 29, 2026 at 12:06 pm

    I suggest you to try to use just $_POST['q16'] as it’s being converted into array

    $q16 = implode(",",$_POST['q16']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem in php code inserting values into database (I use PHPMyAdmin).
i have a problem in inserting the listbox value into mysql database in vb
i have a problem in inserting the listbox value into mysql database in vb
I have problem when inserting a date to my database Insert query: INSERT INTO
I have a problem about inserting values into the table with sqlite. supposing the
I'm having a strange problem in that I have php inserting text into a
i have some SQL code that is inserting values from another (non sql-based) system.
I have this weird problem. I have defined a column in a SQLite database
I have a problem inserting a datetime format variable to Sql Server 2005 database.
i have a problem in inserting some data into a table. I have done

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.