阅读 Google 文档电子表格

发布于 2024-09-15 03:25:07 字数 197 浏览 5 评论 0原文

是否可以使用 PHP 从 Google Docs 电子表格中提取行?

在 SQL 中我会使用类似的内容:

SELECT * FROM table WHERE field = 'value' LIMIT 1

有办法做到这一点吗?我听说你应该使用“Zend”框架,但我也无法弄清楚。任何帮助将不胜感激

Is it possible to pull rows from a Google Docs spreadsheet using PHP?

In SQL I would use something like:

SELECT * FROM table WHERE field = 'value' LIMIT 1

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

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

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

发布评论

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

评论(2

萌面超妹 2024-09-22 03:25:07

来自 Zend_Gdata文档:

<?php
  $query = new Zend_Gdata_Spreadsheets_ListQuery();
  $query->setSpreadsheetKey($spreadsheetKey);
  $query->setWorksheetId($worksheetId);
  $query->setSpreadsheetQuery('name=John and age>25');
  $listFeed = $spreadsheetService->getListFeed($query);
?>

设置$spreadsheetService 对象

<?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 数据 库。

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

And to setup the $spreadsheetService object:

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

You'll need to download either the full Zend Framework, or the standalone Google Data library.

桃气十足 2024-09-22 03:25:07

您要查找的是 Google Visualization API 查询语言

不需要 PHP 中间件即可使其工作。它已经内置到文档中。

这是简介教程帮助您入门。

它是一种类似 SQL 的语法,通过参数化 URI 发送查询来工作。它可以返回 JSON、CSV 或 HTML 表中的匹配数据。它仍然很新,并且有一些怪癖,因此请务必阅读我发布的第二个链接上的所有评论。

What you're looking for is the Google Visualization API Query Language

No need for PHP middleware to get it working. It's already built-in to docs.

Here's a brief introduction tutorial to help get you started.

It's a SQL-like syntax that works by sending the query through a parameterized URI. It can return the matching data in JSON, CSV, or a HTML Table. It's still really new and has a few quirks so be sure to read through all the comments on the second link I posted.

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