为什么此查询总是返回HY093错误

时间:2018-07-06 07:56:47

标签: php mysql pdo prepared-statement

我的查询总是返回Mysql HY093错误,但是为什么呢? 我有所有参数,但仍然无法正常工作...

有人可以帮忙吗?

// create PDO params array
$params = [
    ':employee '    => $formData['employee'],
    ':usedFrom'     => $formData['usedFrom'],
    ':usedTill'     => $formData['usedTill'],
    ':company'      => $formData['company'],
    ':costCenter'   => $formData['costCenter'],
    ':vehicle'      => $formData['vehicle'],
    ':vehicleTag'   => $formData['vehicleTag'],
    ':updatedAt'    => $formData['updatedAt'],
    ':ID'           => $formData['ID']
];

// update entry
$return = $db->pquery(
    'UPDATE entry SET employee_id = :employee, used_from = :usedFrom, used_till = :usedTill, company_id = :company, cost_center_id = :costCenter, vehicle_id = :vehicle, vehicle_tag = :vehicleTag, updated_at = :updatedAt WHERE ID = :ID',
    $params
);

0 个答案:

没有答案