Skip to content

PDO Bind wrong param when string contains hash #18028

Closed as not planned
Closed as not planned
@topnew

Description

@topnew

Description

How to re-produce the problem:

table: test (a varchar(5), b varchar(10))

$sql = 'insert into test(a,b) values (?, ?)';

$stmt->bindParam(1, 'a # a');
$stmt->bindParam(2, 'b # b');

when there is more then 1 vars binded, and the first var contains "#"

it is actually inserted as ('b # b', 'b # b') -- i.e. the binded 1 is using the 2nd

PHP v 8.3.6
Database v : 10.11.8-MariaDB-0ubuntu0.24.04.1

PHP Version

PHP 8.3.6

Operating System

Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions