2017-08-24 58 views
0

卡桑德拉\異常\ InvalidArgumentException:name的值或列Datastax PHP卡桑德拉,獲得「name的值或列」錯誤

我試圖更新從YACassandraPDO一些舊代碼Datastax的新的PHP擴展名,我遇到了一些問題。值得注意的是,這個錯誤。我無法弄清楚爲什麼或錯在哪裏。

參數編號匹配。 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

好吧,我已經發現了問題:colens。 ':關鍵'只需要'關鍵'。

男人,花了太長時間纔看到。我所有的舊綁定名稱是$stmnt->bindValue(':company', [...]);;所以,它完全逃脫了我的觀點。