Take the 2-minute tour ×

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer


