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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:03:28+00:00 2026-05-24T01:03:28+00:00

Can anyone see why i am getting the following error when i try to

  • 0

Can anyone see why i am getting the following error when i try to submit this? I know the whole null vs ” thing but I don’t have any ” that should be causing this. New to mySQL so any help would be great.

Incorrect integer value=” for column ‘two’ at row 1

<?php

$db_host = "localhost";
$db_username = "TEST";

$db_pass = "example";

$db_name = "questions";

@mysql_connect("$db_host","$db_username","$db_pass") or die ("Could not connect to MySQL");
@mysql_select_db("$db_name") or die ("No database");


if ($_POST['parse_var'] == "contactform"){


$oneField = $_POST['one'];
$twoField = $_POST['two'];
$threeField = $_POST['three'];
$noneField = $_POST['none'];
$surveyField = $_POST['survey'];
$questionField = $_POST['questions'];
$guestField = $_POST['guest'];
$homeField = $_POST['home'];


$selected_radio = $_POST['radio'];
  if ($selected_radio == 'one') 
  {
  $oneField = '1';
  }

  else if ($selected_radio == 'two') 
  {
  $twoField = '1';
  }

  else if ($selected_radio == 'three') 
  {
  $threeField = '1';
  }

  else if ($selected_radio == 'none') 
  {
  $noneField = '1';
  }


if($surveyField == "yes"){
$surveyField = "1";
 } 
if($mysqlField == "yes"){
$mysqlField = "1";
 } 
if($guestbookField == "yes"){
$guestbookField = "1";
 } 
if($homeField == "yes"){
$homeField = "1";
 } 

$sqlUpdate = mysql_query("INSERT INTO questiondata (one, two, three, none, survey, 
       question, guest, home)
 VALUES  ('$oneField','$twoField','$threeField','$noneField','$surveyField','$questionField','$guestField','$homeField')")
 or die (mysql_error());
}
?>
  • 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-24T01:03:28+00:00Added an answer on May 24, 2026 at 1:03 am

    You’re trying to INSERT with one of the integer arguments being empty, i.e.:

    INSERT INTO questiondata (one, two) VALUES ('1','')
    

    This will not work unless one or two are string fields.
    Modify your code so empty variables will be initialized:

    $oneField = isset($_POST['one']) ? $_POST['one'] : 0;
    $twoField = isset($_POST['two']) ? $_POST['two'] : 0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following this guide and I am getting an error. Can anyone help me?
I know this is something easy but I just can't see it. Can anyone
Trying to convert the following but am having difficulty. Can anyone see where I'm
Can anyone see from the following function why I would be getting an Invalid
Can anyone see anything wrong with this login script: public function login($username, $pass, $remember)
I'm at my wit's end with this. Can anyone see anything wrong with this
Does anyone know how I can check to see if a directory is writeable
Im getting on error when I try and use the following: <xsl:variable name=url select=guid/>
Does anyone have experience using the URL Rewrite Module (see here )? Can it
I am getting the following error message in my FF console: uncaught exception: Syntax

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.