Datastax PHP Cassandra, получая & quot; Нет значения или столбец для имени & quot; ошибка

Cassandra \ Exception \ InvalidArgumentException: нет значения или столбца для имени

Я пытаюсь обновить старый код из YACassandraPDO до нового расширения PHP Datastax, и у меня возникают некоторые проблемы. Примечательно, что это ошибка. Я не могу понять, почему или что не так.

Номера параметров совпадают. Есть ли что-то кардинально другое, что Datastax делает для подготовленных заявлений?

$query  = "UPDATE {$this->keyspace}.visit  USING TTL {$this->ttl}
SET ip=:ip, browser=:browser, referrer=:ref, terms=:terms
,  url=:url, stime=:stime, etime=:etime
, company=:company, isp=:isp, domain=:domain, client_type = :client_type
, city=:city, state=:state_cd, postal_cd=:postal, country=:country
, country_cd=:country_cd, latitude=:lat, longitude=:long, area_cd=:area_cd
, user_id=:user_id
WHERE visit_dt=:dt AND cid=:cid AND sid=:sid AND pvid=:pvid";

Массив:

    $params = [
':dt'          => new Timestamp(strtotime(date('Y-m-d')), 0),
':cid'         => $data['customerId'],
':sid'         => $data['sid'],
':pvid'        => $data['pvid'],
// Columns
':ip'          => $ip,
':browser'     => utf8_encode($data['browser']),
':client_type' => utf8_encode($device),
':ref'         => utf8_encode($data['referrer']),
':terms'       => utf8_encode($terms),
':url'         => utf8_encode($data['url']),
':stime'       => $data['now'],
':etime'       => $data['etime'],
':user_id'     => $data['userid'],
// Geodecode information
':company'     => utf8_encode($geo->isp),
':domain'      => utf8_encode($geo->domainName),
':isp'         => utf8_encode($geo->isp),
':city'        => utf8_encode($geo->cityName),
':state_cd'    => utf8_encode($geo->regionName),
':country'     => utf8_encode($geo->countryName),
':country_cd'  => utf8_encode($geo->countryCode),
':postal'      => $geo->zipCode,
':lat'         => floatval($geo->latitude),
':long'        => floatval($geo->longitude),
':area_cd'     => $areac
];

Исполнение:

        $prep = $this->adapter()->prepare($stmnt);
$return = $this->adapter()->execute($prep, ['arguments' => $params]);

0

Решение

Хорошо, я обнаружил проблему: колены. «: ключ» должен быть просто «ключ».

Чувак, это заняло слишком много времени, чтобы увидеть. Все мои старые имена были $stmnt->bindValue(':company', [...]);; так что это полностью ускользнуло от моего взгляда.

0

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector