zend谷歌融合表更新 [英] zend google fusion table update

查看:69
本文介绍了zend谷歌融合表更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于任何人,有关如何使用Zend框架在谷歌融合中更新表格的任何想法?

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

我可以得到数据:

$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 :

更新table_id SET column_name =值{,column_name =值} * ROWID = row_id

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

谢谢

推荐答案

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

用法示例:

$client = Zend_Gdata_ClientLogin::getHttpClient('your_login_here@gmail.com', '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登录:

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);

// ...

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

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

这篇关于zend谷歌融合表更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆