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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:10:48+00:00 2026-05-26T23:10:48+00:00

I have an annoying problem with mdb2 while trying to insert empty values in

  • 0

I have an annoying problem with mdb2 while trying to insert empty values in an integer field.

$query = $conn->prepare("INSERT INTO enquiries 
    (type, idvenue, cname, fname, lname, phone, email, date, guests, budget, comments) 
    VALUES (:party, :venue, :cname, :fname, :lname, :phone, :email, :ddate, :guests, :budget, :options)", 
    array('integer', 'integer', 'text', 'text', 'text', 'text', 'text', 'datetime', 'integer', 'integer', 'text'),
    MDB2_PREPARE_MANIP); 

$result = $query->execute($_POST);

my $_POST array is:

                                [party] => 2
                                [venue] => 
                                [anyve] => checked
                                [cname] => 
                                [fname] => Javi
                                [lname] => Prieto
                                [phone] => 078087028492
                                [email] => ravenfewejp@gmfweail.com
                                [ddate] => 10/10/2011
                                [guests] => 10
                                [budget] => 15
                                [options] => My party!

in the moment that :venue is not empty, it works like a charm, even if :cname (text) is still empty, but when :venue is empty like this I get an undefined error. So I guess is happening only with integer fields, what am I missing?

  • 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-26T23:10:49+00:00Added an answer on May 26, 2026 at 11:10 pm

    I realised there’s no problem with passing null values to integer fields in this kind of queries. The problem was I was sending one more element in $_POST when venue was empty, so the number of elements in $_POST was different than the number of placeholders.

    Thanks for the help!

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

Sidebar

Related Questions

I have an annoying CSS layout problem. I'm trying to float images on a
I have come across an annoying problem while writing some PHP4 code. I renamed
I have a very annoying problem and I'm trying to find the simplest solution
I have a weird, annoying problem with Python 2.6. I'm trying to run this
I have a pretty annoying compiling problem. I am trying to do a System.loadlibrary
I have an annoying problem, i have trying to implement a simple 10 or
I've run into a very annoying problem for mobile web. The website I have
I have a annoying problem .. I want my first 4 items in a
I have an annoying problem with the debug mode of Visual C++ 2005. My
i have this annoying problem with my site where, when you click on a

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.