N
N
Nikolay2015-10-26 22:01:00
PHP
Nikolay, 2015-10-26 22:01:00

What's wrong with PDO?

So.
Error in studio:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
'

$stmt = $this->pdo->prepare($this->select_query);  // 'SELECT * FROM companys WHERE VDS_min > :VDS_min'
$stmt->execute($Data_object->get_filds_in_assoc_array()); // Array ( [array] => Array ( ) [return_array] => Array ( ) [VDS_min] => 1 ) ----- print_r();

The error belongs to the $stmt->execute() request.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Defman21, 2015-10-26
@tryvols

Curve bind parameters.

$stmt->execute($Data_object->get_filds_in_assoc_array()['array']['return_array']['VDS_min']);

A
Alexander Aksentiev, 2015-10-26
@Sanasol

Fatal error: Uncaught "PDOException" with message "SQLSTATE [HY093]: Invalid parameter number: number of bound variables does not match number of tokens"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question