php crate 与Crate.io数据存储交互的简单类
php-crate与Crate.io数据存储交互的简单类用法:创建对象实例并添加Crate.io服务器IP地址:
$crate = new PhpCrate();
$crate->setServers(array(\"192.168.10.51\",\"192.168.10.52\",\"192.168.10.53\"));
要创建一个新表:
$sql = \"CREATE TABLE test_table ( id long primary key, name string)\";
$result = $crate->exec($sql);
echo \"Created $result tables\";
填充表示例数据:
$sql = \"INSERT INTO test_table (id, name) VALUES (?,?)\";
用户评论