Export to GitHub

digg - issue #10

PDB query skips special treatment for the Boolean Column


Posted on Mar 14, 2013 by Grumpy Wombat

File: PDB/Common.php

public function query($sql, array $args = array()) { ... if (is_array($args)) { $cnt = count($args); if ($cnt > 0) { foreach ($args as $key => $value) { $param = (is_int($key) ? ($key + 1) : $key);

                    // FIX HERE: (+ https://code.google.com/p/digg/issues/detail?id=9)
                    $data_type = PDO::PARAM_STR;
                    if (is_resource($value)) $data_type = PDO::PARAM_LOB;
                    else if (is_bool($value)) $data_type = PDO::PARAM_BOOL;

                    $result = $stmt->bindParam($param, $args[$key], $data_type);
                }
            }
        }
        // ...
}

Status: New

Labels:
Type-Defect Priority-Medium