Cassandra connection in Yii

50 views
Skip to first unread message

Neerja Negi

unread,
Jul 14, 2015, 5:22:05 AM7/14/15
to phpc...@googlegroups.com
Hi All,

 I was trying to connect my cassandra db connection in Yii.

I edited my main.php file and added the lines given below:

'cassandra' => array
  (
  'class' => 'ext.yii-cassandra-cql3.ACassandraConnection',
  'connectionString'=>'cassandra:host=xxx.xxx.xxx.xxy;port=8080,
                host=xxx.xxx.xxx.xxq;port=9160,
                host=xxx.xxx.xxx.xxw;port=9160,
                host=xxx.xxx.xxx.xxe;port=9160,
                host=xxx.xxx.xxx.xxr;port=9160:dbname=nn_db',
  'username' => 'username',
  'password' => 'password', 
  ),

TempController.php


public function actiontestpages()
{
 //echo "zeroo";die;
 $query_result = Yii::app()->cassandra->cql3_query("Select emop_name from emp_table where emp_id =:emp_id;");
 echo "first";
 $query_result->bindParam(':emp_id',$this->emp_id,PDO::PARAM_INT);
 echo "second";
 $rows = Yii::app()->cassandra->cql_get_rows($query_result);
 echo "third";
 print_r($rows);
 die;
}

When i uncommented the first line i.e.  //echo "zeroo";die; i got an 500 error given below:

Array ( [code] => 500 [type] => CException [errorCode] => 0 [message] => Property "ACassandraConnection.connectionString" is not defined.  [file] => /wservce/framework/YiiBase.php [line] => 220

Please help me out.

Reply all
Reply to author
Forward
0 new messages