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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:43:42+00:00 2026-06-05T10:43:42+00:00

Using the guidance from several Stack Overflow members I’ve gotten an PHP form to

  • 0

Using the guidance from several Stack Overflow members I’ve gotten an PHP form to communicate with my MySQL database. Now, I’m using an array for my checkboxes and the information does get to the MySQL table…sort of..

The code below will insert all of the records into the database but the column that the checkboxes correspond to have the value “Array” instead of the assigned values…:

<?php
 function renderForm($articletitle, $articleorganization, $articledate, $articleurl,     $articletags )
 {
 ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
    <div id="stylized" class="myform">
      <form id="form" name="form" action="" method="post">
. . .
          <input type="checkbox" name="articletags[]" value="checkbox" id="articletags_0" />
          <input type="checkbox" name="articletags[]" value="checkbox 2" id="articletags_1" />
. . .
        <footer><input type="submit" name="submit" value="Add this Article"></footer></form>
    </div>
  </body>
</html><?php 
 }
. . .

 if(count($articletags) > 0)
{
 $articletags_string = implode(",", $articletags);
}

 if (isset($_POST['submit']))
 { 
 $articletitle = mysql_real_escape_string(htmlspecialchars($_POST['articletitle']));
 $articleorganization = mysql_real_escape_string(htmlspecialchars($_POST['articleorganization']));
 $articledate = mysql_real_escape_string(htmlspecialchars($_POST['articledate']));
 $articleurl = mysql_real_escape_string(htmlspecialchars($_POST['articleurl']));
 $articletags = ($_POST['articletags']);

. . .
 mysql_query("INSERT articles SET articletitle='$articletitle',     articleorganization='$articleorganization', articledate='$articledate',     articleurl='$articleurl', articletags='$articletags' ")
 or die(mysql_error()); 


 header("Location:addsuccess.html"); 
 }
 }
 else

 {
 renderForm('','','','');
 }
?>
  • 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-05T10:43:43+00:00Added an answer on June 5, 2026 at 10:43 am

    Since $_POST['articletags'] is an array, you have to convert it to string before saving to your table. Replace this line:

    $articletags = ($_POST['articletags']);
    

    with this:

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

Sidebar

Related Questions

Need some guidance figuring out what went wrong. I've been using mysql, phpmyadmin for
I am using asp.net mvc for an application. I've taken some guidance from Rob
Using the Composite Application Guidance tools from Microsoft, It seems as if there is
I want to load a DropDownList with possible Paises from my database. using System;
I need to export data from several tables in SQL Server 2008 using SSMS.
I see the guidance when using formsAuthentication in ASP.NET is to use SSL via
I would like to ask your guidance on how to authenticate using email add/
Using Java,I have to fetch multiple sets of values from an XML file to
I'm using the below code to transfer an image from one folder on external
I'm looking for some guidance on extracting the rules and property/values from a .css

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.