PHP-Zend Google Fusion Table更新
作者:互联网
作为任何人有任何想法如何使用Zend框架更新Google Fusion中的表格?
我可以得到数据:
$url = "https://www.google.com/fusiontables/api/query?sql=SELECT%20name%20FROM%201695591";
$data = $gdata->get($url);
$postcodes = $data->getRawBody();
但是不知道如何更新行…
我知道我必须“调用”此网址,但不知道如何:
更新table_id
SET column_name =值{,column_name =值} *
WROWE 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登录:
$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/
标签:php,google-fusion-tables 来源: https://codeday.me/bug/20191013/1909421.html