zend google fusion table update

前端 未结 1 1506
别跟我提以往
别跟我提以往 2021-01-24 08:33

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/q         


        
相关标签:
1条回答
  • 2021-01-24 09:19

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

    Example of usage:

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

    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/

    0 讨论(0)
提交回复
热议问题