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

  • Home
  • SEARCH
  • 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 7998527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:14:05+00:00 2026-06-04T15:14:05+00:00

I have a PDO issue with PHP 5.3. I am running MaxDB 7.8 for

  • 0

I have a PDO issue with PHP 5.3. I am running MaxDB 7.8 for my database – if you haven’t heard of that, you’re not alone. It’s an open-source enterprise database that is connected with MySQL on paper, but is nothing like it.

I’m not sure that this issue is caused by MaxDB, but I wanted to mention it.

I found that when using prepared statements via the ODBC driver, my query fails if ANY of the $data array values are empty strings. For example, a user is presented with a dialog box where 1 value is required (‘title’), but 2 are optional (‘author’, ‘version’). If the user chooses not to enter one of the optional values, that array element would be == “”. If this is the case, the $sth->execute($data) fails, complaining of null errors.

I have tried the setAttribute command re: Nulls on all 3 settings, I have tried checking if $value == null { $value = “”; }… and numerous other things I’ve found in articles, all to no avail. If I manually replace any empty values with a string like “(none)”, the query works.

Anyways, here’s the particulars:

$data:


Array
(
[cust] => 1
[ftype] => 1
[title] => test
[author] =>
[version] =>
[folder] => 0
[modified] => 1337394898
[content] => "this is test content"
[status] => 1
[pages] => 1
)

$sql = "INSERT INTO FORMS (CUST, FTYPE, TITLE, AUTHOR, VERSION, FOLDER, MODIFIED, STATUS, CONTENT, PAGES) VALUES (:cust, :ftype, :title, :author, :version, :folder, :modified, :status, :content, :pages)";
$sth = $dbh->prepare($sql) or $this->error($sql, $dbh->errorInfo());
$sth->execute($data);

Thanks in advance for your assistance!

  • 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-04T15:14:06+00:00Added an answer on June 4, 2026 at 3:14 pm

    After days of lost time, I’m giving up on this. If anyone finds a solution, I’d love to hear it but I need to move on.

    My duct tape/chicken wire solution to this is to just remove the possibly-empty values from the list of bound parameters, and include them as part of the SQL statement. That way if something happens to equal ”, it doesn’t freak out & explode.

    Thanks to all who tried.

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

Sidebar

Related Questions

I have an issue with PDO that I'd really like to get an answer
I have a set of PDO statements that do not seem to be working.
Strange issue - I have a live copy of a database class (using PDO)
What happens when two different clients call the same php function that have pdo::beginTransaction?
I have an issue with PDO binding parameters, the parameters that are set are
I have a PDO Query that returns what appears to be an array $pds.
I'm a newcomer to PDO and have to say that I like it so
I have written a tool for database replication in PHP. It's working fine but
I have written a PHP script to pull a query from an Oracle database
I currently have a web server running PHP 5.2.13 and have recently been told:

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.