Note that there are some explanatory texts on larger screens.

plurals
  1. POINSERT SQL statement is not working
    text
    copied!<p>I am on the PostgreSQL system. I've used it before and have not had this issue, but that was for basic select querying.</p> <p>Now I am trying to insert data through an HTML form and php. </p> <p>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....</p> <p>Here is my php/html:</p> <pre><code>&lt;div id='insert_form'&gt; &lt;form method='POST' action='insert.php' onsubmit='return checkSubmit()'&gt; &lt;label id='lbl_header'&gt;&lt;b&gt;Bold&lt;/b&gt; fields are required.&lt;/label&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='code1' id='lbl_code1'&gt;* Country code&lt;/label&gt; &lt;input type='text' name='code1' id='code1' maxlength='3' size='3'/&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='code2' id='lbl_code2'&gt;* Country code (abbr.)&lt;/label&gt; &lt;input type='text' name='code2' id='code2' maxlength='2' size='2'/&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='country_name' id='lbl_name'&gt;* Country name&lt;/label&gt; &lt;input type='text' name='country_name' id='country_name' maxlength='52'/&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='continent' id='lbl_continent'&gt;* Continent&lt;/label&gt; &lt;select name='continent' id='continent'&gt; &lt;option value='Africa'&gt;Africa&lt;/option&gt; &lt;option value='Antarctica'&gt;Antarctica&lt;/option&gt; &lt;option value='Asia'&gt;Asia&lt;/option&gt; &lt;option value='Europe'&gt;Europe&lt;/option&gt; &lt;option value='North America'&gt;North America&lt;/option&gt; &lt;option value='Oceania'&gt;Oceania&lt;/option&gt; &lt;option value='South America'&gt;South America&lt;/option&gt; &lt;/select&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='region' id='lbl_region'&gt;* Region&lt;/label&gt; &lt;input type='text' name='region' id='region' maxlength='26' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='area' id='lbl_area'&gt;* Surface area&lt;/label&gt; &lt;input type='text' name='area' id='area' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label for='indepYear' id='lbl_year'&gt;Year of independence&lt;/label&gt; &lt;input type='text' name='indepYear' id='indepYear' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='population' id='lbl_pop'&gt;* Population&lt;/label&gt; &lt;input type='text' name='population' id='population' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label for='lifeExp' id='lbl_lifeExp'&gt;Life expectancy&lt;/label&gt; &lt;input type='text' name='lifeExp' id='lifeExp' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label for='gnp' id='lbl_gnp'&gt;GNP&lt;/label&gt; &lt;input type='text' name='gnp' id='gnp' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label for='gnp_old' id='lbl_gnp_old'&gt;GNP (old)&lt;/label&gt; &lt;input type='text' name='gnp_old' id='gnp_old' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='local_name' id='lbl_local_name'&gt;* Local name&lt;/label&gt; &lt;input type='text' name='local_name' id='local_name' maxlength='45' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label class='required' for='govt' id='lbl_govt'&gt;* Form of government&lt;/label&gt; &lt;input type='text' name='govt' id='govt' maxlength='45' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label for='HoS' id='lbl_HoS'&gt;Head of state&lt;/label&gt; &lt;input type='text' name='HoS' id='HoS' maxlength='60' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label for='capital' id='lbl_capital'&gt;Capital code&lt;/label&gt; &lt;input type='text' name='capital' id='capital' /&gt; &lt;br /&gt;&lt;br /&gt; &lt;label&gt;&lt;a href='index.php'&gt;Return to Selection Page&lt;/a&gt;&lt;/label&gt; &lt;input type='submit' name='submit' value='Insert row' /&gt; &lt;/form&gt; ?&gt; </code></pre> <p>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? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload