web browser doesn't show any data from cassandra connection in php

时间:2017-11-13 06:46:00

标签: php cassandra-3.0

i am newbie in cassnadra.

i want to show cassnadra data with php.

i tried with netbeans and it worked.( my os is linux) my question is why it does not work in web browser. is anybody there to answere me.

does it related to web browser's permision ???????

<?php

//use Cassandra;

//require_once 'Cassandra.php';
error_reporting(-1);
ini_set('display_errors', 'On');


$cluster   = Cassandra::cluster()                 // connects to localhost by default
                 ->build();

$keyspace  = 'new';
$session   = $cluster->connect($keyspace);        // create session, optionally scoped to a keyspace
$statement = new Cassandra\SimpleStatement(       // also supports prepared and batch statements
    'SELECT * FROM new.country_by_id');

$future    = $session->executeAsync($statement);  // fully asynchronous and easy parallel execution
$result    = $future->get();                      // wait for the result, with an optional timeout

foreach ($result as $row) {                       // results and rows implement Iterator, Countable and ArrayAccess
    print  $row['country_name']."<br />";


}


?>

it work in cmd but not work in web browser.

pls help

thank you

0 个答案:

没有答案