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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:28:55+00:00 2026-06-17T22:28:55+00:00

In one server setup I experience very strange error. There’s PHP 5.3.6 with PDO

  • 0

In one server setup I experience very strange error. There’s PHP 5.3.6 with PDO Driver for MySQL, client library version 5.1.61. Everything is compiled by hand.

When I bind params with bindValue and set third parameter as \PDO::PARAM_BOOL then statement execute return false and nothing happens (no data inserted to MySQL, even no exception at all). When I don’t use third parameter it goes well. In fact I can’t ommit third parameter, bacues Doctrine2 DBAL sets it while converting parameters…

Here’s code:

<?php
$pdo = new \PDO('mysql:host=***;dbname=***', '***', '***'); // hidden DB access
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);

$stmt = $pdo->prepare('insert into outage (name, description, start_at, end_at, is_exception, extranet_id) values (?,?,?,?,?,?)');
$stmt->bindValue(1, 'Test name', \PDO::PARAM_STR);
$stmt->bindValue(2, 'Test desc', \PDO::PARAM_STR);
$stmt->bindValue(3, '2012-01-01 00:00:00', \PDO::PARAM_STR);
$stmt->bindValue(4, null, \PDO::PARAM_NULL);
$stmt->bindValue(5, false, \PDO::PARAM_BOOL);
$stmt->bindValue(6, 2, \PDO::PARAM_INT);
var_dump(array('stmt result' => ($result = $stmt->execute()), 'last insert id' => $pdo->lastInsertId(), 'stmt err code' =>  $stmt->errorCode(), 'pdo err code' =>  $pdo->errorCode()));

Result:

array(4) {
  ["stmt result"]=>
  bool(false)
  ["last insert id"]=>
  string(1) "0"
  ["stmt err code"]=>
  string(5) "00000"
  ["pdo err code"]=>
  string(5) "00000"
}

What possibly could go wrong? I’ve tried it on other 4 servers and didn’t get this bug. Also if I pass ‘0’ (as a string) to $stmt->bindValue(5, false, \PDO::PARAM_BOOL); it works good.

  • 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-17T22:28:56+00:00Added an answer on June 17, 2026 at 10:28 pm

    I had the same problem on Ubuntu with PHP 5.3.10. (Interestingly there was no problem on windows with wamp…)

    Actually it’s a known bug in pdo: https://bugs.php.net/bug.php?id=38546

    I use PDO::PARAM_INT instead of PDO::PARAM_BOOL. It works well, and you do not have to convert booleans to string like above.

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

Sidebar

Related Questions

one my server instances has started to go haywire in a multi-instance setup running
I have 2 servers setup at the moment. One is a web server running
Liferay migration from one server to another help required. Can anyone share there steps
I work extensively with MySQL and have no experience with SQL Server. But I
I have a production mysql server. And one server for backups, with mysql slave
We're migrating from one server to another and a VBA script to save attachments
I have migrated Project server from one server to another. I am able to
I have a few SQL Server databases (all in one server), containing their own
When I copy a database from one server to another via backup and restore,
I'm trying to connect from one server to another using FTP. By using command

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.