0

I have following code in which I want to know the value of bind parameter:

$sql->bindParam( ':checkbox', $value['CHECKBOXLIST'], PDO::PARAM_STR );

How can i know value of :checkbox variable?

This variable i am passing to IN query of WHERE clause, but unable to get result. This is a statement. $value['CHECKBOXLIST'] returns array like 1,2,3,4.

where Checkbox IN (:checkbox)

How can I also handle it?

pad
  • 41,040
  • 7
  • 92
  • 166
alpesh
  • 37
  • 1
  • 5

1 Answers1

0

PDOStatement->bindParam() stores a reference to a PHP variable:

bool PDOStatement::bindParam ( mixed $parameter , mixed &$variable [, int $data_type = PDO::PARAM_STR [, int $length [, mixed $driver_options ]]] )

When you run the query, the value is read from such variable. So the value is right in that variable, in your case $value['CHECKBOXLIST']. If you remove or overwrite the variable before running the query, the value will be lost.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360