如何修复未找到表定义的错误?

发布于 2024-12-20 22:40:29 字数 558 浏览 4 评论 0原文

有谁知道为什么我收到以下错误消息?我开始了解 Facebook 开发的世界,但找不到简单的答案。

代码:

$twitterUrl ="http://query.yahooapis.com/v1/public/yql?q=";
$twitterUrl .= urlencode("select * from twitter.status where id='jzm'");
$twitterUrl .="&format=json";

$twitterFeed = file_get_contents($twitterUrl, true);
$twitterFeed = json_decode($twitterFeed);

print_r($twitterFeed);

收到错误:

stdClass Object ( [error] => stdClass Object ( [lang] => en-US [description] => No definition found for Table twitter.status ) )

Does anyone know why I am getting the below error message? I am starting to learn the world of Facebook development and I cannot find a simple answer.

Code:

$twitterUrl ="http://query.yahooapis.com/v1/public/yql?q=";
$twitterUrl .= urlencode("select * from twitter.status where id='jzm'");
$twitterUrl .="&format=json";

$twitterFeed = file_get_contents($twitterUrl, true);
$twitterFeed = json_decode($twitterFeed);

print_r($twitterFeed);

Error received:

stdClass Object ( [error] => stdClass Object ( [lang] => en-US [description] => No definition found for Table twitter.status ) )

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

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

发布评论

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

评论(2

隔岸观火 2024-12-27 22:40:29

尝试将 &env=http://datatables.org/alltables.env 添加到您的查询中。

   $twitterUrl ="http://query.yahooapis.com/v1/public/yql?q=";
    $twitterUrl .= urlencode("SELECT * FROM twitter.status WHERE id='jzm'");
    $twitterUrl .="&format=json";
    $twitterUrl .="&env=http://datatables.org/alltables.env";

    $twitterFeed = file_get_contents($twitterUrl, true);
    $twitterFeed = json_decode($twitterFeed);

    print_r($twitterFeed);

Try adding &env=http://datatables.org/alltables.env to your query.

   $twitterUrl ="http://query.yahooapis.com/v1/public/yql?q=";
    $twitterUrl .= urlencode("SELECT * FROM twitter.status WHERE id='jzm'");
    $twitterUrl .="&format=json";
    $twitterUrl .="&env=http://datatables.org/alltables.env";

    $twitterFeed = file_get_contents($twitterUrl, true);
    $twitterFeed = json_decode($twitterFeed);

    print_r($twitterFeed);
一瞬间的火花 2024-12-27 22:40:29

问题是,您正在尝试加载 Yahoo API 默认情况下无法识别的打开表。

因此,您可以在查询前添加以下查询前缀:

USE 'http://www.datatables.org/twitter/twitter.status.xml' AS twitter.status;

这将加载 自定义社区表,之后您可以使用它。

一般语法为:

USE "http://myserver.com/mytables.xml" AS mytable;
SELECT * FROM mytable WHERE...

阅读更多:在 YQL 中调用开放数据表定义< /a>

The problem is, that you're trying to load the open table which Yahoo API doesn't recognise by default.

So you may prefix your query by the following query:

USE 'http://www.datatables.org/twitter/twitter.status.xml' AS twitter.status;

This will load the custom community table, so after that you can use it.

The general syntax is:

USE "http://myserver.com/mytables.xml" AS mytable;
SELECT * FROM mytable WHERE...

Read more: Invoking an Open Data Table Definition within YQL

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