Skip to content

Can't use bind(Int|String|DoubleBlob) methods on unnamed parameters #14

@adrianhardy

Description

@adrianhardy
$stmt = $db->prepare("SELECT * FROM tblTable WHERE intStuff = ?");
$stmt->bindInt(1, 9);
$stmt->fetchOne();

Falls through to:

private function process($arr_params = NULL)
{
       if (NULL === $arr_params) {
            if ($this->int_state === self::STATE_BOUND) {
                $str_sql = preg_replace_callback("/\?(\w+)/", array($this, 'replaceTypedParams'), $this->str_prepare_sql);

But the preg_replace_callback will find nothing and therefore no params are bound. Looking into reasonable fixes....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions