zend google fusion 表更新

发布于 2024-12-07 18:52:50 字数 376 浏览 3 评论 0原文

有人知道如何使用 Zend 框架更新 google fusion 中的表吗?

我可以获得数据:

$url = "https://www.google.com/fusiontables/api/query?sql=SELECT%20name%20FROM%201695591";
$data = $gdata->get($url);

$postcodes = $data->getRawBody();

但不知道如何更新一行...... 我知道我必须“调用”这个网址,但不知道如何:

UPDATE table_id SET 列名 = 值 {, 列名 = 值 }* WHERE ROWID = row_id

谢谢

As anyone any idea on how to update a table in google fusion using Zend framework?

I can get the data:

$url = "https://www.google.com/fusiontables/api/query?sql=SELECT%20name%20FROM%201695591";
$data = $gdata->get($url);

$postcodes = $data->getRawBody();

But have no idea how to update a row ...
I know I have to 'call' this url, but no idea how :

UPDATE table_id
SET column_name = value {, column_name = value }*
WHERE ROWID = row_id

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

败给现实 2024-12-14 18:52:50

尝试这个类 http://barahlo.semero.com/description/Zend_Gdata_Fusion.zip

示例使用方法:

$client = Zend_Gdata_ClientLogin::getHttpClient('[email protected]', 'your_pass_here', 'fusiontables');

$base = new Zend_Gdata_Fusion($client);


$sql = "SELECT ROWID FROM 596524 WHERE id = 1;";
$rowdata =  $base->query($sql)->get_array();
print_r($rowdata);

$newRowId = $base->insertRow('596524',array(
    'id' => time(),
    'name' => 'trird row',
    'added' => date('n/j/y'),
) );

$base->updateRow(
    '596524', 
    array('name' => 'new first row'), 
    $rowdata[1][0] //ROWID from insert query
);

Zend_Gdata 的 Oauth 登录:

$oauthOptions = array( 
'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER, 
'version' => '1.0', 
'signatureMethod' => 'HMAC-SHA1', 
'consumerKey' => $CONSUMER_KEY, 
'consumerSecret' => $CONSUMER_SECRET 
); 

$consumer = new Zend_Oauth_Consumer($oauthOptions); 
$token = new Zend_Oauth_Token_Access(); 
$client = $token->getHttpClient($oauthOptions,null);

$base = new Zend_Gdata_Fusion($client);

// ...

另外,还有官方的 php 客户端库 http://code.google.com/p/fusion-tables-client-php/

Try this class http://barahlo.semero.com/description/Zend_Gdata_Fusion.zip

Example of usage:

$client = Zend_Gdata_ClientLogin::getHttpClient('[email protected]', 'your_pass_here', 'fusiontables');

$base = new Zend_Gdata_Fusion($client);


$sql = "SELECT ROWID FROM 596524 WHERE id = 1;";
$rowdata =  $base->query($sql)->get_array();
print_r($rowdata);

$newRowId = $base->insertRow('596524',array(
    'id' => time(),
    'name' => 'trird row',
    'added' => date('n/j/y'),
) );

$base->updateRow(
    '596524', 
    array('name' => 'new first row'), 
    $rowdata[1][0] //ROWID from insert query
);

Oauth login for Zend_Gdata:

$oauthOptions = array( 
'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER, 
'version' => '1.0', 
'signatureMethod' => 'HMAC-SHA1', 
'consumerKey' => $CONSUMER_KEY, 
'consumerSecret' => $CONSUMER_SECRET 
); 

$consumer = new Zend_Oauth_Consumer($oauthOptions); 
$token = new Zend_Oauth_Token_Access(); 
$client = $token->getHttpClient($oauthOptions,null);

$base = new Zend_Gdata_Fusion($client);

// ...

Also, there is official php client library http://code.google.com/p/fusion-tables-client-php/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文