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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:41:25+00:00 2026-06-12T00:41:25+00:00

I am on the PostgreSQL system. I’ve used it before and have not had

  • 0

I am on the PostgreSQL system. I’ve used it before and have not had this issue, but that was for basic select querying.

Now I am trying to insert data through an HTML form and php.

I do not get an error back when I fill out the data (even when I input all fields on the form) so I assume it should be inserted….

Here is my php/html:

<div id='insert_form'>
<form method='POST' action='insert.php' onsubmit='return checkSubmit()'>
  <label id='lbl_header'><b>Bold</b> fields are required.</label>
  <br /><br />
  <label class='required' for='code1' id='lbl_code1'>* Country code</label>
  <input type='text' name='code1' id='code1' maxlength='3' size='3'/>
  <br /><br />
  <label class='required' for='code2' id='lbl_code2'>* Country code (abbr.)</label>
  <input type='text' name='code2' id='code2' maxlength='2' size='2'/>
  <br /><br />
  <label class='required' for='country_name' id='lbl_name'>* Country name</label>
  <input type='text' name='country_name' id='country_name' maxlength='52'/>
  <br /><br />
  <label class='required' for='continent' id='lbl_continent'>* Continent</label>
  <select name='continent' id='continent'>
    <option value='Africa'>Africa</option>
    <option value='Antarctica'>Antarctica</option>
    <option value='Asia'>Asia</option>
    <option value='Europe'>Europe</option>
    <option value='North America'>North America</option>
    <option value='Oceania'>Oceania</option>
    <option value='South America'>South America</option>
  </select>


  <br /><br />
  <label class='required' for='region' id='lbl_region'>* Region</label>
  <input type='text' name='region' id='region' maxlength='26' />
  <br /><br />
  <label class='required' for='area' id='lbl_area'>* Surface area</label>
  <input type='text' name='area' id='area' />
  <br /><br />
  <label for='indepYear' id='lbl_year'>Year of independence</label>
  <input type='text' name='indepYear' id='indepYear' />
  <br /><br />
  <label class='required' for='population' id='lbl_pop'>* Population</label>
  <input type='text' name='population' id='population' />
  <br /><br />
  <label for='lifeExp' id='lbl_lifeExp'>Life expectancy</label>
  <input type='text' name='lifeExp' id='lifeExp' />
  <br /><br />
  <label for='gnp' id='lbl_gnp'>GNP</label>
  <input type='text' name='gnp' id='gnp' />
  <br /><br />
  <label for='gnp_old' id='lbl_gnp_old'>GNP (old)</label>
  <input type='text' name='gnp_old' id='gnp_old' />
  <br /><br />
  <label class='required' for='local_name' id='lbl_local_name'>* Local name</label>
  <input type='text' name='local_name' id='local_name' maxlength='45' />
  <br /><br />
  <label class='required' for='govt' id='lbl_govt'>* Form of government</label>
  <input type='text' name='govt' id='govt' maxlength='45' />
  <br /><br />
  <label for='HoS' id='lbl_HoS'>Head of state</label>
  <input type='text' name='HoS' id='HoS' maxlength='60' />
  <br /><br />
  <label for='capital' id='lbl_capital'>Capital code</label>
  <input type='text' name='capital' id='capital' />
  <br /><br />
  <label><a href='index.php'>Return to Selection Page</a></label>
  <input type='submit' name='submit' value='Insert row' />
</form>


?>

The connect file has already been proven to work in my past projects so I know that’s not the issue. I’ve compiled it and it also says thats not the issue. Any idea why it would not be inserting into the database? Or maybe a function I could add on to the end with an if statement that could check if it had actually been inserted?

  • 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-12T00:41:26+00:00Added an answer on June 12, 2026 at 12:41 am

    Using INSERT in the fashion that you are, you must ensure that the contents of the VALUES () clause exactly match the number and order of columns in the table. If there are any columns that you are not including, even if they have default values or are autonumbered, the command will fail. Since you don’t show any information about your table I don’t know whether this is the source of your problem or not.

    If it is the problem, you can use the full form of INSERT:

     INSERT INTO county (col1, col2, col3) VALUES ($val1, $val2, $val3)
    

    This form is highly recommended in any event as it makes no assumptions about the table (other than the names of the columns) and guards against the command failing from structural changes to the table later on.

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

Sidebar

Related Questions

Assume that you have this code in C#/.NET (using PostgreSQL via ODBC): using System.Data.Odbc;
Postgresql version: 9.1.2 PgAdmin iii version: 1.14.0 Operating system used: ubuntu 10.04 i have
I have a query on a PostgreSQL system returning a boolean: my $sth =
We are writing an inventory system and I have some questions about sqlalchemy (postgresql)
Using PostgreSQL triggers, is it possible to record the changes that have happened to
Usually I worked with PostgreSQL and never had a problem, but now I need
I have a parameterized postgresql query that users interact with through a PHP front-end.
I have a PostgreSQL\PostGIS spatial database which contains Hebrew text columns. The system runs
I have a suite of system tests that uses Spring's JUnit runner, the database
I have ubuntu 11.10 (target system) with PostgreSQL running on it. Also I have

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.