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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:22:26+00:00 2026-06-06T03:22:26+00:00

Using a form I am inserting the information from 3 text fields and 2

  • 0

Using a form I am inserting the information from 3 text fields and 2 checkboxes into a MySQL database.

The database consists of 2 tables with the following rows:

id - articletitle - articleorganization - articledate - articleurl

id - article_tags - articlid - tagid 

The checkboxes use an array and are coded thus:

<input type="checkbox" name="articletags[]" value="geology" id="articletags_0" />
<input type="checkbox" name="articletags[]" value="astronomy" id="articletags_1" />

And the MySQL statement looks like this:

mysql_query("INSERT INTO articles SET articletitle='$articletitle',
 articleorganization='$articleorganization',
 articledate='$articledate',
 articleurl='$articleurl' ")

mysql_query2("INSERT INTO articles_tags SET articletags='$articletags' ")

However, when I visit the page in a web browser it shows a blank page.

In case anyone is wondering, the reason I’m using checkboxes is because the articles will need to be tagged with a combination of tags, and this will ensure that consistency is used in the tagging. Also, I have a form used to edit the articles, and the database structure could, I believe, be used to make the checkboxes “checked” on the edit page.

Any advice is greatly appreciated.

  • 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-06T03:22:28+00:00Added an answer on June 6, 2026 at 3:22 am

    The blank page is actually from a syntax error. To see syntax errors, edit the php.ini or add this line to the top of your code error_reporting(E_ALL);

    Change mysql_query2() to mysql_query()

    Your SQL sytax is incorrect…

    If the data is already in the database you want to use UPDATE.

    mysql_query("UPDATE articles SET articletitle='$articletitle',
     articleorganization='$articleorganization',
     articledate='$articledate',
     articleurl='$articleurl' ");
    
    mysql_query("UPDATE articles_tags SET articletags='$articletags' ")
    

    This is how you insert data:

    mysql_query("INSERT INTO articles (articletitle,
     articleorganization,
     articledate,
     articleurl) VALUES ($articletitle,$articleorganization,$articledate,$articleurl) ");
    

    Note: You should use mysql_error() to check for syntax errors.

    mysql_query("INSERT INTO articles_tags SET articletags='$articletags' ") OR DIE(mysql_error());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm inserting some data into a database from a form. I'm using addslashes to
im using a form in php to submit some information into my database so
I am inserting a web form into the database and so using parameterized queries.
I'm using an XMLHttpRequest for inserting some rows to a MYSQL database. I defined
I am inserting some information to my database and i am using the following
I was inserting multiple arrays into my database using this code: $queries_cols = array();
I'm having trouble inserting data into a table. I have the following tables: track
I'm inserting data from a jsf page to database using managed beans. But the
I am trying to insert an entry into a database using a form created
I have a form view which is inserting data into a sql-server-2008 database. instead

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.