阅读Google文档电子表格 [英] Reading Google docs spreadsheet
本文介绍了阅读Google文档电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用PHP从Google Docs电子表格中拉行?
Is it possible to pull rows from a Google Docs spreadsheet using PHP?
在SQL中,我会使用类似于:
In SQL I would use something like:
SELECT * FROM table WHERE field = 'value' LIMIT 1
有没有办法做到这一点?我听说你应该使用'Zend'框架,但我还没有弄清楚。任何帮助将不胜感激
Is there a way to do this? I've heard you are supposed to use a 'Zend' framework, but I haven't been able to figure that out either. Any help would be appreciated
推荐答案
从 Zend_Gdata 文档:
From the Zend_Gdata documentation:
<?php
$query = new Zend_Gdata_Spreadsheets_ListQuery();
$query->setSpreadsheetKey($spreadsheetKey);
$query->setWorksheetId($worksheetId);
$query->setSpreadsheetQuery('name=John and age>25');
$listFeed = $spreadsheetService->getListFeed($query);
?>
<?php
$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
$spreadsheetService = new Zend_Gdata_Spreadsheets($client);
$feed = $spreadsheetService->getSpreadsheetFeed();
?>
您需要下载完整的 Zend Framework ,或独立的 Google数据图书馆。
You'll need to download either the full Zend Framework, or the standalone Google Data library.
这篇关于阅读Google文档电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文